round

round given value


Parameters

round value :integer :floating :rational

Attributes

to:integerround to given decimal places

Returns

  • :floating

Examples

copy
print round 2.1 ; 2.0 print round 2.9 ; 3.0 print round 6 ; 6.0 print round to :rational [29 10] ; 3.0 print round to :rational [21 10] ; 2.0 print round to :rational [5 2] ; 3.0 print round pi ; 3.0

copy
print round.to:5 pi ; 3.14159 print round.to:2 pi ; 3.14

Related