Next: srand, Previous: sprintf, Up: C library functions [Index]
sqrt
Function#include <math.h> Array instanceMethod printSquareRoot (void) { Float new squareRoot; WriteFileStream classInit; /* * Use Ctalk C API library function calls within a C function. */ squareRoot = sqrt(__ctalk_to_c_double(__ctalk_self_internal ())); stdoutStream writeStream squareRoot; return NULL; } int main () { Array new floatArray; floatArray atPut 0, 1.0; floatArray atPut 1, 4.0; floatArray atPut 2, 9.0; floatArray atPut 3, 16.0; floatArray atPut 4, 25.0; floatArray map printSquareRoot; }