ROBOTC has a powerful collection of useful math functions for the NXT, TETRIX, VEX CORTEX, and Arduino MEGA-based platforms. The RCX, VEX PIC and Arduino 328P-based platforms do not have enough memory to store these more advanced math functions or support floating point numbers.

atof

taskmain(){string strPI = "3.14"; // string 'strPI' is set equal to "3.14"float test = atof(strPI); // convert the string value of 'strPI' to a float and set 'test' to that number (3.14)while(true); // keep the ROBOTC debugger alive so we can see the result}

atoi

taskmain(){string strPI = "3.14"; // string 'strPI' is set equal to "3.14"long test = atoi(strPI); // convert the string value of 'strPI' to a long and set 'test' to that number (3)while(true); // keep the ROBOTC debugger alive so we can see the result}

ceil

float ceil(const float input)

(float) Returns the smallest integer value that is greater than or equal to input.