1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00
QB64-PE/internal/help/CINT_1111.txt
Roland Heyder aeb9c0668b Updates help files for use with new Wiki parser (2nd try)
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
2022-05-21 00:18:31 +02:00

39 lines
1.1 KiB
Plaintext

{{QBDLDATE:05-20-2022}}
{{QBDLTIME:23:12:13}}
The [[CINT]] function rounds decimal point numbers up or down to the nearest [[INTEGER]] value.
{{PageSyntax}}
: {{Parameter|value%}} = [[CINT]]({{Parameter|expression}})
{{Parameters}}
* {{Parameter|expression}} is any [[TYPE]] of literal or variable numerical value or mathematical calculation.
{{PageDescription}}
* Values greater than .5 are rounded up. Values lower than .5 are rounded down.
* ''Warning:'' Since [[CINT]] is used for integer values, the input values cannot exceed 32767 to -32768!
* Use [[CLNG]] for [[LONG]] integer values exceeding [[INTEGER]] limitations.
* Note: When decimal point values are given to BASIC functions requiring [[INTEGER]]s the value will be [[CINT]]ed.
{{PageExamples}}
''Example:'' Shows how CINT rounds values up or down as in "bankers' rounding".
{{CodeStart}}
a% = {{Cl|CINT}}(1.49): b% = {{Cl|CINT}}(1.50): c = 11.5
{{Cl|COLOR}} c: {{Cl|PRINT}} a%, b%, c
{{CodeEnd}}
{{OutputStart}}{{text|1 2 11.5|red}}
{{OutputEnd}}
{{PageSeeAlso}}
* [[_ROUND]], [[_CEIL]]
* [[CLNG]], [[CSNG]], [[CDBL]]
* [[INT]], [[FIX]]
{{PageNavigation}}