Difference between revisions of "-"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
m (Normalise with other arithmetic operator pages)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The '''-''' mathematical operator performs subtraction on two numerical values or [[negation|negates]] a single value.
+
The [[-]] mathematical operator performs subtraction on two numerical values or [[negation|negates]] a single value.
  
  
 
+
{{PageSyntax}}
''Syntax:'' return_value = number1 - number2
+
:return_value = number1 [[-]] number2
 
 
  
  
 
{{PageDescription}}
 
{{PageDescription}}
 
 
* Numbers used can be any literal or variable numerical value type.  
 
* Numbers used can be any literal or variable numerical value type.  
 
* Subtracting a negative value will actually perform addition with the other value.  
 
* Subtracting a negative value will actually perform addition with the other value.  
 
* Subtracting a negative or [[negation|negated]] value will make the return value more positive.
 
* Subtracting a negative or [[negation|negated]] value will make the return value more positive.
* Addition and subtraction are the last operations performed in Qbasic's normal order of operations.
+
* Addition and subtraction are the last operations performed in QBasic's normal order of operations.
 
* Subtraction cannot be performed on [[STRING]] values.
 
* Subtraction cannot be performed on [[STRING]] values.
  
  
 
+
{{PageSeeAlso}}
''See also:''
+
* [[+|+ positive]] (addition operator)
 
+
* [[Mathematical Operations]]
[[+|+ positive]] (addition operator)
 
 
 
[[Mathematical Operations]]
 
 
 
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Latest revision as of 16:26, 28 February 2021

The - mathematical operator performs subtraction on two numerical values or negates a single value.


Syntax

return_value = number1 - number2


Description

  • Numbers used can be any literal or variable numerical value type.
  • Subtracting a negative value will actually perform addition with the other value.
  • Subtracting a negative or negated value will make the return value more positive.
  • Addition and subtraction are the last operations performed in QBasic's normal order of operations.
  • Subtraction cannot be performed on STRING values.


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page