PHP Classes

File: Math.xbt

Recommend this page to a friend!
  Classes of Bob Wedwick  >  PHP Expert System Engine  >  Math.xbt  >  Download  
File: Math.xbt
Role: Auxiliary data
Content type: text/plain
Description: Xbert rule set
Class: PHP Expert System Engine
Ask questions and make decisions based on answers
Author: By
Last change:
Date: 4 years ago
Size: 1,435 bytes


Class file image Download
 /*  Math.xbt -- Math Tests for XbertClass.php

	For the following commands, the result is saved in variable3 if it is given.
	The result is always saved in the local variable <>.

	MAXimum value1 value2 [variable3] -- the greater of value1 or value2 is saved
	MINimum value1 value2 [variable3]  --  the lesser of value1 or value2
	ADD value1 value2 [variable3]  -- value1 plus value2
	SUBtract value1 value2 [variable3]  -- value1 minus value2
	MULtiply value1 value2 [variable3]  -- value1 * value2
	DIVide value1 value2 [variable3]  -- value1 / value2
	Tests are compared with the contents of <>.
	[variable3] is not used for these tests.
4	,,Testing math commands
	,,--- Menu ----
	,,1. MAX maximum string or numbers
	,,2. MIN minimum string or numbers
	,,3. ADD add numbers
	,,4. SUB subtract numbers
	,,5. MUL multiply numbers
	,,6. DIV divide numbers
	,,Anything else = no test.
	,,- - - - -
	,ask,Run which test?
	,gte,<> 1
	,lte, <> 6
#,,Test the MAX command at node 5
++	,EQU,1
	,glo,<test> MAX
#,,Test the MIN command at node 5
-+	,EQU,2
	,glo,<test> MIN
#,,Test the ADD command
5	,EQU,3
	,glo,<test> ADD
#,,Test the SUB command
5	,EQU,4
	,glo,<test> SUB
#,,Test the MUL command
5	,EQU,5
	,glo,<test> MUL
#,,Test the DIV command
5	,EQU,6
	,glo,<test> DIV
#,,Ended tests
4	,,= = = = =
5	,pau,That is all.
For more information send a message to info at phpclasses dot org.