Math Functions Design Program

Math Functions is composed of two functions which are used in other programs to facilitate the design process by simplifying the algorithm where possible.

RoundNearest
Inputs:(number,array)
This function takes both a number and an array as its inputs and returns the number in the array that is closest to the inputted number. This function assumes that the array is ordered with the smallest number in the first cell.

ramp
Inputs:(start,interval,range)
This function takes a starting number, an interval and a range and returns an array with those characteristics. The range is the number of values you want in the array (this means the desired end value minus the start value plus 1). The function then begins with the start value and continues to increase at the desired interval, until its range is as inputted.

  • No labels