1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 10:00:23 +00:00
qb64/internal/help/_CEIL.txt

36 lines
909 B
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_CEIL}}
2017-10-10 14:55:21 +00:00
The [[_CEIL]] function rounds a numeric value up to the next whole number or [[INTEGER]] value.
2016-03-18 11:36:04 +00:00
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: {{Parameter|result}} = [[_CEIL]]({{Parameter|expression}})
2016-03-18 11:36:04 +00:00
2017-10-10 14:55:21 +00:00
* [[_CEIL]] returns he smallest integral value that is greater than the numerical {{Parameter|expression}} (as a floating-point value).
2016-03-18 11:36:04 +00:00
* This means that [[_CEIL]] rounds up for both positive and negative numbers.
2017-10-10 14:55:21 +00:00
==Availability==
* '''Version 1.000 and up.'''
2016-03-18 11:36:04 +00:00
2017-10-10 14:55:21 +00:00
{{PageExamples}}
2016-03-18 11:36:04 +00:00
''Example:'' Displaying the rounding behavior of [[INT]], [[CINT]] and [[FIX]] vs [[_CEIL]].
{{CodeStart}}
PRINT INT(2.5), CINT(2.5), FIX(2.5), _CEIL(2.5)
PRINT INT(-2.5), CINT(-2.5), FIX(-2.5), _CEIL(-2.5)
{{CodeEnd}}
{{OutputStart}} 2 2 2 3
-3 -2 -2 -2
{{OutputEnd}}
2017-10-10 14:55:21 +00:00
{{PageSeeAlso}}
2016-03-18 11:36:04 +00:00
* [[INT]], [[FIX]]
* [[CINT]], [[CLNG]],
* [[CSNG]], [[CDBL]]
* [[_ROUND]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}