7.10.1  Float functions and macros

even(N). Test whether N is even, returns 1 when true, 0 when false.
Parameters

odd(N). Test whether N is odd, returns 1 when true, 0 when false.
Parameters

Interpolate(GC, GS, GE, TS, TE, Method). Interpolation macro, interpolates between the float values TS and TE. The method of interpolation is cosine, linear or exponential. The position where to evaluate the interpolation is determined by the position of GC in the range GS - GE. See example.
Parameters:

Example:
  #declare A = Interpolate(0.5, 0, 1, 0, 10, 1);
  #debug str(A,0,2)
  // result A = 0.50

  #declare A = Interpolate(0.0,-2, 2, 0, 10, 1);
  #debug str(A,0,2)
  // result A = 0.50

  #declare A = Interpolate(0.5, 0, 1, 0, 10, 2);
  #debug str(A,0,2)  
  // result A = 0.25

Mean(A). Compute the average of an array of values.
Parameters:

Std_Dev(A, M). Standard deviation.
Parameters:

GetStats(ValArr). This macro declares a global array named "StatisticsArray" containing: N, Mean, Min, Max, and Standard Deviation
Parameters:

Histogram(ValArr, Intervals). This macro declares a global, 2D array named "HistogramArray". The first value in the array is the center of the interval/bin, the second the number of values in that interval.
Parameters:

sind(v), cosd(v), tand(v), asind(v), acosd(v), atan2d(a, b). Versions of the trigonometric functions using degrees as the angle unit.
Parameters:
The same as for the analogous built-in trig function.

max3(a, b, c). Find the largest of three numbers.
Parameters:

min3(a, b, c). Find the smallest of three numbers.
Parameters:

f_sqr(v). Square a number.
Parameters:

sgn(v). The sign of the number. Returns -1 or 1 depending on the sign of v.
Parameters:

clip(V, Min, Max). Limits a value to a specific range, if it goes outside that range it is "clipped". Input values larger than Max will return Max, those less than Min will return Min.
Parameters:

clamp(V, Min, Max). Limits a value to a specific range, if it goes outside that range it is "clamped" to this range, wrapping around. As the input increases or decreases outside the given range, the output will repeatedly sweep through that range, making a "sawtooth" waveform.
Parameters:

adj_range(V, Min, Max). Adjusts input values in the range [0, 1] to a given range. An input value of 0 will return Min, 1 will return Max, and values outside the [0, 1] range will be linearly extrapolated (the graph will continue in a straight line).
Parameters:

adj_range2(V, InMin, InMax, OutMin, OutMax). Like f_range(), but adjusts input values in the range [InMin, InMax] to the range [OutMin, OutMax].
Parameters: