DataBasic Reference > Statements and Intrinsic Functions > I > INT Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

INT Function (DataBasic) (m618703+int_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

INT Function

Returns the integer value of a given expression.

Syntax

INT(expression)

Syntax Elements

expression is any valid DataBasic expression or any string, substring, or value; expressed as a variable name, a value, or a string enclosed in quotes.

Operation

INT returns the integer value of expression. The fractional portion of expression is truncated.

If expression is a fraction, INT returns a value of 0.

Examples

I = 5/3
J = INT(I)

Assigns the value 1 to variable J.

PRINT INT(.25)

Prints the value 0, because expression is a fraction.

A = 3.9
B = 3.65
C = INT(A+B)
D = INT(A-B)

Assigns the value 7 to variable C and the value 0 to variable D.

A = INT(-5.7)

Assigns the value -5 to variable A.

RealityV15.1 (MoTW) Revision 7Comment on this topic