Difference between revisions of "Ceil"

(digits parameter)
Line 2: Line 2:
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
Returns the smallest integer that is greater than or equal to X.
+
= Ceil(x'', digits'') =
  
  Ceil(X)
+
[[Ceil]](x) returns the smallest integer that is greater than or equal to «x».
 +
 
 +
:[[Ceil]](174.001) &rarr; 175
 +
:[[Ceil]](-89.95) &rarr; -89
 +
 
 +
''Note: The «digits» parameter is only available in Analytica 4.3 and higher''
 +
 
 +
When the optional «digits» parameter is given, cuts the number off at «digits» to the right of the decimal, returning the smallest multiple of 10<sup>-«digits»</sup> that is equal to or larger than «x».
 +
 
 +
:[[Ceil]]( 3.141592,2) &rarr;  3.150000
 +
:[[Ceil]](-3.141592,2) &rarr; -3.140000
 +
:[[Ceil]]( 3.141592,5) &rarr; 3.141600
 +
 
 +
«digits» may also be negative, in which case the least significant -«digits» digits will be '0':
 +
 
 +
::[[Ceil]](123456.789, -1) &rarr; 123460.00
 +
::[[Ceil]](123456,789, -4) &rarr; 130000.00
 +
 
 +
= Number Format =
 +
 
 +
The [[Ceil]], [[Round]] and [[Floor]] functions all cut a number off to the indicated number of decimal places, but note that this is separate from the number format used to display the number.  The number format setting controls how many digits are shown when displaying numbers, such as in an edit or result table.  For example, after rounding to 4 decimal places, a number may be 2.3456, but if your number format is set to fixed point with 2 digits, this would display as 2.35.
 +
 
 +
To see the full effect of the [[Ceil]] function, set the number format to a large number of digits.
  
 
= See Also =
 
= See Also =
  
* [[Floor]]
+
* [[Floor]](x'', digits'')
* [[Round]]
+
* [[Round]](x'', digits'')

Revision as of 08:31, 23 December 2009


Ceil(x, digits)

Ceil(x) returns the smallest integer that is greater than or equal to «x».

Ceil(174.001) → 175
Ceil(-89.95) → -89

Note: The «digits» parameter is only available in Analytica 4.3 and higher

When the optional «digits» parameter is given, cuts the number off at «digits» to the right of the decimal, returning the smallest multiple of 10-«digits» that is equal to or larger than «x».

Ceil( 3.141592,2) → 3.150000
Ceil(-3.141592,2) → -3.140000
Ceil( 3.141592,5) → 3.141600

«digits» may also be negative, in which case the least significant -«digits» digits will be '0':

Ceil(123456.789, -1) → 123460.00
Ceil(123456,789, -4) → 130000.00

Number Format

The Ceil, Round and Floor functions all cut a number off to the indicated number of decimal places, but note that this is separate from the number format used to display the number. The number format setting controls how many digits are shown when displaying numbers, such as in an edit or result table. For example, after rounding to 4 decimal places, a number may be 2.3456, but if your number format is set to fixed point with 2 digits, this would display as 2.35.

To see the full effect of the Ceil function, set the number format to a large number of digits.

See Also

Comments


You are not allowed to post comments.