CALC 1 Home Documentation Home Contact

CALC 1 c1 Mathematical and Miscellaneous Functions

Use the JavaScript Math Object for most of your mathematical constants and functions.

The CALC 1 c1 object has trigonometric functions that take into account the degree-radian mode of the calculator. sin, cos, tan, asin, acos, atan, and atan2. So c1.sin(30) = 0.5 when the calculator in DEG mode. The JavaScript Math trig functions, like most trig function, take radians as an argument.

Function Description Example Result
ln(x) The natural logarithm of x. CALC 1 has the ln() function since most calculators use 'ln' for the natural logarithm and having an ln( appear in the ALG mode avoids the confusion of displaying 'log(' after pressing the 'ln' key. c1.ln(1.55) 0.44
erf(lower, upper) Calculates the error function integrated between the lower and upper values. c1.erf( 0, 1) 0.84
erfc(x) Calculates the complementary error function (complementary Gauss error function). c1.erfc(1) 0.1573
fact(x) The factorial of a number, n!. fact(5) 120
fma(x, y, z) The fma() function compute (x*y)+z, rounded as one ternary operation. c1.fma(20, 9/5, 32) 68
gamma(x) The gamma function. c1.gamma(0.5) 1.77
gammaln(x) Calculates the natural logarithm of the absolute value of the gamma function of x. c1.gammaln(0.5) 0.57
cc(fromValue, fromCode, toCode) Convert currency function. Used the current conversion rates to convert currencies.
The Currency Conversions Form Calculator has a "Create Key" button that will build a call to this function with the codes selected in the calculator.
A list of supported codes can be found here.
//Converts USD in rgx to EUR
c1.cc(c1.rgx, 'USD', 'EUR');
 
round(value) Rounds value to the current number format settings. This includes fixed, significant and fraction settings. c1.round(141.421356237); 141.42 // fix(2)
141 // sd(3)
141.4375 // frac(16)