/: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "The '''/''' mathematical operator performs decimal point 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 "Division by zero" error! due to CINT rounding. * Return values can be any literal or variable numerical type, but SINGLE or DOUBLE...")
 
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 2: Line 2:




 
{{PageSyntax}}
{{PageSyntax}}  
: {{Parameter|return_value}} = {{Parameter|number}} [[/]] {{Parameter|divisor}}
::: return_value = number '''/''' divisor
 




{{PageDescription}}
{{PageDescription}}
* Number value can be any literal or variable numerical type.
* 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 can be any literal or variable numerical type, but [[SINGLE]] or [[DOUBLE]] type decimal point returns are likely.
* Return values can be any literal or variable numerical type, but [[SINGLE]] or [[DOUBLE]] type decimal point returns are likely.
* Values returned may be expressed using exponential or [[scientific notation]] using '''E''' for SINGLE or '''D''' for DOUBLE precision.
* Values returned may be expressed using exponential or [[scientific notation]] using '''E''' for SINGLE or '''D''' for DOUBLE precision.
* Use the [[\|\ integer division]] operator to guarantee [[INTEGER]] or [[LONG]] return values.
* Use the [[\|\ integer division]] operator to guarantee [[INTEGER]] or [[LONG]] return values.
* Division and multiplication operations are performed before addition and subtraction in Qbasic's order of operations.
* Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations.




''See also:''
{{PageSeeAlso}}
* [[MOD|MOD (remainder division operator)]]
* [[\|\ (integer division operator)]]
* [[INT]], [[CINT]], [[FIX]], [[_ROUND]]
* [[Mathematical Operations]]
* [[Mathematical Operations]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 22:30, 31 January 2023

The / mathematical operator performs decimal point division on a numerical value.


Syntax

return_value = number / divisor


Description

  • Number value can be any literal or variable numerical type.
  • Return values can be any literal or variable numerical type, but SINGLE or DOUBLE type decimal point returns are likely.
  • Values returned may be expressed using exponential or scientific notation using E for SINGLE or D for DOUBLE precision.
  • Use the \ integer division operator to guarantee INTEGER or LONG return values.
  • Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations.


See also



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