Int: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''
Int(''number'')
Int(''number'')


Line 5: Line 7:
Int removes the fractional part of a number, returning the next smallest integer. The required parameter, ''number'', is any valid numeric expression.
Int removes the fractional part of a number, returning the next smallest integer. The required parameter, ''number'', is any valid numeric expression.


== Example==  
== Example (Basic) ==  


<pre>
<pre>
Rem Int Example
Rem Int Example
'Int converts floats to the next smallestint
'Int converts floats to the next smallest integer
Dim Pos, Neg
Dim Pos, Neg
Pos = Atn(1) * 4
Pos = Atn(1) * 4
Line 31: Line 33:


[[Category:Math]]
[[Category:Math]]
[[Category:BASIC Functions]]

Latest revision as of 15:27, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

Int(number)

Description

Int removes the fractional part of a number, returning the next smallest integer. The required parameter, number, is any valid numeric expression.

Example (Basic)

Rem Int Example
'Int converts floats to the next smallest integer
Dim Pos, Neg
Pos = Atn(1) * 4
Neg = -Pos
Print "Int(pi) = " & Int(Pos)
Print "Int(-pi) = " & Int(Neg)

Output

Int(pi) = 3
Int(-pi) = -4

Related Items

Fix