20-sim webhelp > Language Reference > Functions > Arithmetic > trunc


trunc

Navigation:  Language Reference > Functions > Arithmetic >

trunc

Previous pageReturn to chapter overviewNext page

Syntax

Y = trunc(X);

Description

Rounds X or the elements of X towards zero (i.e. the function trunc removes the fraction).

Examples

X

trunc(X)

1

1

2.1

2

-2.6

-2

3.4

3

[1.1,-2.7;3.5,-4.1]

[1,-2;3,-4]

 

Limitations

X and Y must have the same size.