Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Improve floor, ceil, round docs

Closed / Fixed530535ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-03-15 23:06:37
% expr {round(1.2)}
1
% expr {floor(1.2)}
1.0
% expr {ceil(1.2)}
2.0

So round() is different.  Don't know why.

The difference is important, and the documentation
should emphasize it more.
dkfplain2002-03-21 18:59:46
Logged In: YES 
user_id=79902

Problem is documentation for floor/ceil which doesn't
distinguish clearly between integer (no fractional part) and
integral (zero fractional part) - probably because they
mirror the libm docs virtually verbatim - whereas the
documentation for round (which is not part of libm) is quite
clear.
dkf Closed ticket [530535ffff]. [History diff]2002-03-21 20:30:42
dkfplain2002-03-21 20:30:45
Logged In: YES 
user_id=79902

Clarified docs for floor() and ceil(); please reopen or
submit another bug if you feel round() needs improvement
(and you can suggest a cross-platform way to describe what
it does that also distinugishes between it and int()!)
dkf Ticket [530535ffff]: 2 changes [History diff]2002-03-21 20:30:48
Log in (anonymous is fine) to add a comment.