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/%5C_%51.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

49 lines
1.3 KiB
Plaintext

{{QBDLDATE:05-20-2022}}
{{QBDLTIME:23:24:56}}
The '''\''' mathematical operator performs [[INTEGER]] division on a numerical value.
{{PageSyntax}}
::: return_value = number '''\''' divisor
{{PageDescription}}
* Number value can be any literal or variable numerical type.
* '''Divisor (second value) must not be a value of 0 to .5'''. This will create a [[ERROR Codes|"Division by zero" error!]] due to [[CINT]] rounding.
* Return values will be [[INTEGER]] or [[LONG]] value types only.
* Rounding is done to the closest EVEN [[INTEGER|integer]] or [[LONG|long integer]] value.
* Use the [[/]] integer division operator for [[SINGLE]] or [[DOUBLE]] floating decimal point return values.
* Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations.
''Example:'' Displays how floating decimal point values are rounded to the closest even [[INTEGER|integer]] value.
{{CodeStart}}
{{Cl|PRINT}} 0.5 \ 1
{{Cl|PRINT}} 1.5 \ 1
{{Cl|PRINT}} 2.5 \ 1
{{Cl|PRINT}} 3.5 \ 1
{{Cl|PRINT}} 4.5 \ 1
{{Cl|PRINT}} 5.5 \ 1
{{CodeEnd}}
{{OutputStart}}0
2
2
4
4
6
{{OutputEnd}}
''See also:''
* [[MOD|MOD (remainder division operator)]]
* [[/|/ (normal division operator)]]
* [[INT]], [[CINT]], [[FIX]], [[_ROUND]]
* [[Mathematical Operations]]
{{PageNavigation}}