Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-12-10
02:22 • Closed ticket [3455625fff]: bad rounding plus 7 other changes artifact: 794b614bc1 user: ferrieux
2011-12-09
18:11 • New ticket [3455625fff]. artifact: c89c04f580 user: tavrow

bad rounding

Closed / Invalid3455625fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-12-09 18:11:07
in tclsh8.6b2 on Linux see the following bad rounding examples

% expr 47*0.01 
0.47000000000000003
% expr -83*0.01 
-0.8300000000000001

This happens on about 1% of numbers.

lee
ferrieuxplain2011-12-10 02:22:28
Exact base-2 and base-10 fractional representations do not coincide.
See http://wiki.tcl.tk/1650
Log in (anonymous is fine) to add a comment.