INT Function

Returns the whole number, fuzzed to avoid unexpected floating-point results.

Category:Truncation
Returned data type:DOUBLE

Syntax

Required Argument

expression

specifies any expression that evaluates to a numeric value.

Data typeDOUBLE
See<sql-expression> Expression
FedSQL Expressions

Details

In FedSQL, INT is a reserved word. To use the function, you must specify the function name as a delimited identifier.

The INT function returns the whole number portion of the argument (truncates the decimal portion). If the argument's value is within 1E-12 of a whole number, the function results in that whole number. If the value of expression is positive, the INT function has the same result as the FLOOR function. If the value of expression is negative, the INT function has the same result as the CEIL function.

Comparisons

Unlike the INTZ function, the INT function fuzzes the result. If the argument is within 1E-12 of a whole number, the INT function fuzzes the result to be equal to that whole number. The INTZ function does not fuzz the result. Therefore, with the INTZ function, you might get unexpected results.

Example

The following statements illustrate the INT function:

Function Examples

Statements

Results

select "int"(2.6);
2
select "int"(-2.4);
-2
select "int"(1+1.3-11);
-8
select "int"(-1.6); 
-1

See Also

Last updated: September 14, 2026