_CEIL

From QB64 Phoenix Edition Wiki
Revision as of 04:15, 19 April 2022 by SMcNeill (talk | contribs) (Created page with "{{DISPLAYTITLE:_CEIL}} The _CEIL function rounds a numeric value up to the next whole number or INTEGER value. {{PageSyntax}} : {{Parameter|result}} = _CEIL({{Parameter|expression}}) * _CEIL returns he smallest integral value that is greater than the numerical {{Parameter|expression}} (as a floating-point value). * This means that _CEIL rounds up for both positive and negative numbers. ==Availability== * '''Version 1.000 and up.''' {{PageExam...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The _CEIL function rounds a numeric value up to the next whole number or INTEGER value.


Syntax

result = _CEIL(expression)


  • _CEIL returns he smallest integral value that is greater than the numerical expression (as a floating-point value).
  • This means that _CEIL rounds up for both positive and negative numbers.


Availability

  • Version 1.000 and up.


Examples

Example: Displaying the rounding behavior of INT, CINT and FIX vs _CEIL.

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)
 2        2         2         3
-3       -2        -2        -2


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link