'<ADbasic Header, Headerversion 001.001>
'<Header End>
#DEFINE PI 4*arctan(1)

FUNCTION CEIL(value) AS FLOAT
  DIM floatValue AS FLOAT
  DIM integerValue AS INTEGER
	
  floatValue = value + 0.5
  integerValue = floatValue	
  CEIL = integerValue
ENDSUB

FUNCTION FLOOR(value) AS FLOAT
  DIM integerValue AS INTEGER
	
  integerValue = value	
  FLOOR = value
ENDSUB

FUNCTION TRUNC(value) AS INTEGER
	
  TRUNC = FLOOR(value)
ENDSUB


FUNCTION POWER(xValue,yValue) AS FLOAT
	
  POWER = xValue^(yValue)
ENDSUB

FUNCTION SIGN(xValue) AS FLOAT
  if(xValue > 0) then SIGN=1 endif
  if(xValue = 0) then SIGN=0 endif
  if(xValue < 0) then SIGN=-1 endif
  POWER = xValue^(yValue)
ENDSUB
