Here is my latest round-to-integer.  It rounds the absolute value and then
restores the sign -- the way I was taught to round.  Apologies if someone
else has already presented this.

    ri =: * * [: <. 0.5 + |
    ri _1234.56
 _1235
    ri 123.45
 123

--Kip Murray


-- 
Sent from Gmail Mobile
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to