[back] [prev] [next] [index] [root]

 


Trunc

Returns the integer part of a number.

Syntax:

y := Trunc(x);

integer
  y  
real
  x  

See also:  Round, Floor, Ceil

Description:

Given an x in Z, Q or R the function returns \left{ \begin{array}{r@{quad:quad}l} \max{ k\inZ : k <= x} & x >= 0 \min{ k\inZ : k >= x} & x < 0 \end{array} right. . The computation is done in the current precision of the real (complex) field.


Example:


kash> Trunc(1);
1
kash> Trunc(-1);
-1
kash> Trunc(1.1);
1
kash> Trunc(-1.1);
-1
kash> Trunc(1.6);
1
kash> Trunc(-1.6);
> -1


<- back[back] [prev] [next] [index] [root]