Table 36. Correspondence Between Clib and ECMAScript Methods
|
|
|
abs() |
Calculates absolute value |
Math.abs() |
acos() |
Calculates the arc cosine |
Math.acos() |
asin() |
Calculates the arc sine |
Math.asin() |
atan() |
Calculates the arc tangent |
Math.atan() |
atan2() |
Calculates the arc tangent of a fraction |
Math.atan2() |
atof() |
Converts a string to a floating-point number |
Automatic conversion |
atoi() |
Converts a string to an integer |
Automatic conversion |
atol() |
Converts a string to a long integer |
Automatic conversion |
ceil() |
Rounds a number up to the nearest integer |
Math.ceil() |
cos() |
Calculates the cosine |
Math.cos() |
exp() |
Computes the exponential function |
Math.exp() |
fabs() |
Computes the absolute value of a floating-point number |
Math.abs() |
floor() |
Rounds a number down to the nearest integer |
Math.floor() |
fmod() |
Calculates the remainder |
% operator, modulo |
labs() |
Returns the absolute value of a long |
Math.abs() |
log() |
Calculates the natural logarithm |
Math.log() |
max() |
Returns the largest of one or more values |
Math.max() |
min() |
Returns the smallest of one or more values |
Math.min() |
pow() |
Calculates x to the power of y |
Math.pow() |
sin() |
Calculates the sine |
Math.sin() |
sqrt() |
Calculates the square root |
Math.sqrt() |
strcat() |
Appends one string to another |
+ operator |
strcmp() |
Compares two strings |
== operator |
strcpy() |
Copies a string |
= operator |
strlen() |
Gets the length of a string |
string.length |
strlwr() |
Converts a string to lowercase |
string.toLowerCase |
strtod() |
Converts a string to decimal |
Automatic conversion |
strtol() |
Converts a string to long |
Automatic conversion |
strupr() |
Converts a string to uppercase |
string.toUpperCase |
tan() |
Calculates the tangent |
Math.tan() |
tolower() |
Converts a character to lowercase |
string.toLowerCase |
toupper() |
Converts a character to uppercase |
string.toUpperCase |