ROUND: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 20: Line 20:
{{Cl|PRINT}} {{Cl|_ROUND}}(3.5)
{{Cl|PRINT}} {{Cl|_ROUND}}(3.5)
{{Cl|PRINT}} {{Cl|_ROUND}}(4.5)
{{Cl|PRINT}} {{Cl|_ROUND}}(4.5)
{{Cl|PRINT}} {{Cl|_ROUND}}(5.5)  
{{Cl|PRINT}} {{Cl|_ROUND}}(5.5)
{{CodeEnd}}
{{CodeEnd}}
{{OutputStart}}0
{{OutputStart}}0
Line 31: Line 31:




''See also:''
{{PageSeeAlso}}
* [[INT]], [[CINT]]
* [[INT]], [[CINT]]
* [[FIX]], [[CLNG]]
* [[FIX]], [[CLNG]]
Line 37: Line 37:


{{PageNavigation}}
{{PageNavigation}}
[[Category:Latest]]

Latest revision as of 01:02, 29 January 2023

The _ROUND function rounds to the closest even INTEGER, LONG or _INTEGER64 numerical value.


Syntax

value = _ROUND(number)


Description


Example: Displays how QB64 rounds to the closest even integer value.

PRINT _ROUND(0.5)
PRINT _ROUND(1.5)
PRINT _ROUND(2.5)
PRINT _ROUND(3.5)
PRINT _ROUND(4.5)
PRINT _ROUND(5.5)
0
2
2
4
4
6


See also



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