ScriptBasic:UsersGuide 25.88

From ScriptBasic
Jump to: navigation, search


25. Command reference

25.88. INT

[<<<] [>>>]

This function returns the integral part of the argument. INT(undef) is undef or raises an error if the option RaiseMatherror is set in bit sbMathErrUndef. Other than this the function returns integer value.

The difference between INT and FIX is that INT truncates down while FIX truncates towards zero. The two functions are identical for positive numbers. In case of negative arguments INT will give a smaller number if the argument is not integer. For example:

  int(-3.3) = -4
  fix(-3.3) = -3

See FIX.

[<<<] [>>>]