|
|
Example of _OP_MULTIPLY_EQUALS
|
|
|
Code
|
# foo1 := -3 #
# foo2 := 5.5 #
# foo1 *= 0 #
foo1 multiplied by 0 = # foo1 #
# foo1 *= 8 #
foo1 multiplied by positive integer = # foo1 #
# foo1 *= -8 #
foo1 multiplied by negative integer = # foo1 #
And if there were any doubts, 0 does equal -0
Therefore <_if else="-0 bad" test="0 == -0" then="-0 ok" />
Floating points work as well as integers
# foo2 *= 3 #
Therefore foo2 *= 3 assigns # foo2 # to foo2
|
Output
|
foo1 multiplied by 0 = -0
foo1 multiplied by positive integer = -0
foo1 multiplied by negative integer = 0
And if there were any doubts, 0 does equal -0
Therefore -0 ok
Floating points work as well as integers
Therefore foo2 *= 3 assigns 16.5 to foo2
|
Ref
|
x.6803
|
XML Script homepage
| Documentation home
| XML Script docs
| Command list
| Function list
| X-Tract docs
X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited © Copyright 1998-2000 DecisionSoft Limited
|