These math functions return a double precision value and take a double precision argument. The exception is atan2() which has two double precision arguments.
Arguments that are out of range give an argument domain diagnostic.
These functions call the library routines supplied by the compiler.
absolute value
see Vector.abs() for the Vector class.
square root
see Vector.sqrt() for the Vector class.
returns the exponential function to the base e
When exp is used in model descriptions, it is often the case that the cvode variable step integrator extrapolates voltages to values which return out of range values for the exp (often used in rate functions). There were so many of these false warnings that it was deemed better to turn off the warning message when Cvode is active. In any case the return value is exp(700). This message is not turned off at the interpreter level or when cvode is not active.
for i=690, 710 print i, exp(i)
logarithm to the base e see Vector.log() for the Vector class.
logarithm to the base 10
see Vector.log10() for the Vector class.
trigonometric function of radian argument.
see Vector.sin()
trigonometric function of radian argument.
see Vector.sin() for the Vector class.
hyperbolic tangent. see Vector.tanh() for the Vector class.
Example:
atan2(0,0) for i=-1,1 { print atan2(i*1e-6, 10) } for i=-1,1 { print atan2(i*1e-6, -10) } for i=-1,1 { print atan2(10, i*1e-6) } for i=-1,1 { print atan2(-10, i*1e-6) } atan2(10,10) atan2(10,-10) atan2(-10,10) atan2(-10,-10)