WRAPVALUE

This command will return a value that does not exceed the range of 0 to 360.

  Syntax
Return Float=WRAPVALUE(Angle Value)
  Parameters
Angle Value
Float
Specify the angle value in degrees between 0 and 360.

  Returns

This value is a float number such as 0.5

  Description

Where a value is specified that exceeds this range, the command will wrap the value around to bring it back within the range. This command is best understood by using the number of a clock as a mental picture of how a number wraps. If the clock hand points to 11 and is then advanced 2 hours, the number has to wrap from 12 around to 1 to keep the cycle going. The parameter should be specified using a real number.

  Example Code
DO
A=WRAPVALUE(A+1)
PRINT A
LOOP
  See also

CORE Commands Menu
Index