Difference between revisions of "Formulas: Numerical functions"

Jump to: navigation, search
(Numerical functions)
(Numerical functions)
 
(3 intermediate revisions by the same user not shown)
Line 57: Line 57:
 
|-
 
|-
 
| fact(x)
 
| fact(x)
| Factorial of x. Gives the numerical value up to fact(170) and INF thereafter. [[Formulas:_More_examples#Factorial|See examples.]]
+
| Factorial of x. Gives the numerical value up to fact(170) and INF thereafter. See [[Formulas:_More_examples#Factorial|these examples ↗]].
 
|-
 
|-
 
| floor(x)
 
| floor(x)
Line 133: Line 133:
  
 
[[Formulas_question_type|← FORMULAS QUESTION TYPE]]
 
[[Formulas_question_type|← FORMULAS QUESTION TYPE]]
 +
 +
===In other languages===
 +
[https://docs.moodle.org/all/es/F%C3%B3rmulas:_Funciones_num%C3%A9ricas Español]<br>
 +
[https://docs.moodle.org/3x/fr/Formules:_Fonctions_numériques Français]

Latest revision as of 00:30, 14 January 2018

Numerical functions

The numerical functions available in the Formulas question type are listed in the table below:

Function Definition
No argument
pi() Value of π (=3.14159...)
One argument
abs(x) Absolute value
acos(x) Arccosine (in radians)
acos(x) returns a numeric value between 0 and π radians for x between -1 and 1, otherwise NAN
Examples:
acos(-2) = NAN
acos(-1) = 3.1415926535898
acos(0) = 1.5707963267949
acos(0.5) = 1.0471975511966
acos(1) = 0
acos(2) = NAN
acosh(x) Inverse hyperbolic cosine
asin(x) Arcsine (in radians)
asinh(x) Inverse hyperbolic sine
atan(x) Arctangent (in radians)
atanh(x) Inverse hyperbolic tangent
ceil(x) Ceiling function
ceil(x) = ⌈x⌉ is the smallest integer greater or equal to x
cos(x) Cosine of a value given in radians
cosh() Hyperbolic cosine
deg2rad() Converts a degree value to a radian value
exp(x) Exponential function
exp(x) = ex where (= 2.71828...) is the base of the natural logarithm
expm1(x)
fact(x) Factorial of x. Gives the numerical value up to fact(170) and INF thereafter. See these examples ↗.
floor(x) Floor function
floor(x) = ⌊x⌋ is the largest integer less than or equal to x
is_finite(x)
is_infinite(x)
is_nan(x)
log(x)
log10x()
log1px()
rad2deg(x) Converts a radian value to a degree value
round(x) Rounds a value to the nearest integer
sin(x) Sine of a value given in radians
sinh(x) Hyperbolic sine
sqrt(x) Square root
tan(x) Tangent of a value given in radians
tanh(x) Hyperbolic tangent
Two arguments
atan2(y,x)
fmod(x,y)
log(x,base)
pow(x,y) The base x taken to the exponent y
pow(x,y) = xy
round(x,precision)
Several arguments
min(x1,x2,...) Returns the lowest value
max(x1,x2,...) Returns the highest value

Note that the functions used in the variable assignments is (almost) a superset of the functions used in the algebraic formulas.


Back to top of page

← FORMULAS QUESTION TYPE

In other languages

Español
Français