INT

Contents


int returns the mathematical integer part of its argument.

 

Syntax

   int( exp_num )

 

Parameters

Element

Description

Restrictions

exp_num

Numerical expression.

-1e80< exp_num <1e80

 

Examples

   Infbox num$(pi)-num$( int(pi))    : # displays 3, 14… and 3
   X =
int(-pi)                      :# X = -4
   Y =
int(-5)                       :# Y = -5

 

Description and comments

int(X) returns:
    fix(X) if X is positive, null or integer,
    fix(X)-1 if X is strictly negative and is not an integer.

The result is an Integer or Decimal type depending on whether or not the result belongs in the range [ -2^31, 2^31-1 ].

 

Associated errors

Error

Description

ERMODE (10)

The argument is not a numerical type.

 

Associated key words

FIX - AR2 - ARR - INTEGER - MOD


CONTENTS


Copyright © Sage 1999 - 2007