wiki:plugin_math

Mathematical functions plugin

This plugin provides some basic mathematical functions. This plugin will always be linked statically into LCD4Linux, and therefore does not follow the plugin_name::function scheme.


Constants

The Plugin defines the following variables:

Pi3.14159....
e2.718...

Functions:

sqrt(x)square root
exp(x)base-e exponential function
ln(x)natural logarithmic
log(x)base-10 logarithmic
sin(x)sine function
cos(x)cosine function
tan(x)tangent function
ceil(x)round up to next integer
floor(x)round down to next integer
min(a,b)minimum of a and b
max(a,b)maximum of a and b
decode(index,...)return parameter specified by index

decode() examples

expressionresult
decode(-1,'a','b')''
decode(0,'a','b')'a'
decode(1,'a','b')'b'
decode(2,'a','b')''
decode(3,'a','b','c','d','e','f')'d'

Last modified 12 years ago Last modified on 01/21/07 07:28:27