Difference between revisions of "Math functions"

Line 6: Line 6:
 
These functions can be accessed from the '''Math '''library from the '''Definition '''menu.
 
These functions can be accessed from the '''Math '''library from the '''Definition '''menu.
  
'''Abs(x)''': Returns the absolute value of '''x'''. When '''x '''in complex, returns the magnitude, see [[Complex number functions]].
+
'''Abs(x)''': Returns the absolute value of <code>x</code>. When <code>x</code> in complex, returns the magnitude, see [[Complex number functions]].
 +
:<code>Abs(180) &rarr; 180</code>
 +
:<code>Abs(-210) &rarr; 210</code>
  
:'''Abs(180) '''&rarr;'''180'''
+
'''Ceil(x)''': Returns the smallest integer that is greater than or equal to <code>x</code>.
 
+
:<code>Ceil(3.1) &rarr; 4</code>
:'''Abs(-210) '''&rarr;'''210'''
+
:<code>Ceil(5) &rarr; 5</code>
 
+
:<code>Ceil(-2.9999) &rarr; -2</code>
'''Ceil(x)''': Returns the smallest integer that is greater than or equal to '''x'''.
+
:<code>Ceil(-7) &rarr; -7</code>
 
 
:'''Ceil(3.1) '''&rarr;'''4'''
 
 
 
:'''Ceil(5) '''&rarr;'''5'''
 
 
 
:'''Ceil(-2.9999) '''&rarr;'''-2'''
 
 
 
:'''Ceil(-7) '''&rarr;'''-7'''
 
  
 
'''Ceil(x,digits)''': Returns the smallest number with the indicated of digits to the right of the decimal that is greater than or equal to x.
 
'''Ceil(x,digits)''': Returns the smallest number with the indicated of digits to the right of the decimal that is greater than or equal to x.
 +
:<code>Ceil(Pi,4) &rarr; 3.1416</code>
 +
:<code>Ceil(-12345,-2) &rarr; -12300</code>
  
:'''Ceil(Pi,4) '''&rarr;'''3.1416'''
+
'''Floor(x)''': Returns the largest integer that is smaller than or equal to <code>x</code>.
 
+
:<code>Floor(2.999) &rarr; 2</code>
:'''Ceil(-12345,-2) '''&rarr;'''-12300'''
+
:<code>Floor(3) &rarr; 3</code>
 
+
:<code>Floor(-2.01) &rarr; -3</code>
'''Floor(x)''': Returns the largest integer that is smaller than or equal to '''x'''.
+
:<code>Floor(-5) &rarr; -5</code>
 
 
:'''Floor(2.999) '''&rarr;'''2'''
 
 
 
:'''Floor(3) '''&rarr;'''3'''
 
 
 
:'''Floor(-2.01) '''&rarr;'''-3'''
 
 
 
:'''Floor(-5) '''&rarr;'''-5'''
 
  
 
==See Also==
 
==See Also==

Revision as of 13:39, 7 September 2015


Analytica User Guide > Using Expressions > Math functions

These functions can be accessed from the Math library from the Definition menu.

Abs(x): Returns the absolute value of x. When x in complex, returns the magnitude, see Complex number functions.

Abs(180) → 180
Abs(-210) → 210

Ceil(x): Returns the smallest integer that is greater than or equal to x.

Ceil(3.1) → 4
Ceil(5) → 5
Ceil(-2.9999) → -2
Ceil(-7) → -7

Ceil(x,digits): Returns the smallest number with the indicated of digits to the right of the decimal that is greater than or equal to x.

Ceil(Pi,4) → 3.1416
Ceil(-12345,-2) → -12300

Floor(x): Returns the largest integer that is smaller than or equal to x.

Floor(2.999) → 2
Floor(3) → 3
Floor(-2.01) → -3
Floor(-5) → -5

See Also

Function calls and parameters <- Math functions -> Numbers and text
Comments


You are not allowed to post comments.