Petit Computer Wiki
Petit Computer Wiki
Advertisement

V1[]

Indications are, ABS in SmileBasic V1 is identical to that in V2.

V2[]

ABS(numerical value) returns the 'absolute value' of the number given. If the given number is zero or positive, the result is the same as the given number; if the given number is negative, the result is the given number with the sign swapped (i.e. made positive, with the same magnitude, or 'distance from zero'). The result of ABS is never negative.

Except for a bug. ABS(&H80000) will give the result -0.

V3[]

Indications are, ABS in SmileBasic V3 is identical to that in V2, except hopefully, the "-0" bug is fixed.

Advertisement