Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-07-03
08:03 • Closed ticket [3349507fff]: Incorrect rounding converting bignum to double p... artifact: c519193ff6 user: kennykb
2011-07-02
21:26 • New ticket [3349507fff]. artifact: e3305feb5c user: kennykb

Incorrect rounding converting bignum to double

Closed / Duplicate3349507fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-07-02 21:26:16
Converting bignums to double is supposed to do 'round to even' so that the rounding will be unbiased. It does 'round up' always.

Example:

% expr double(1[string repeat 0 23])
1.0000000000000001e+23

The given number lies precisely between two adjacent 'double' values, and is incorrectly converted rounding up.

Expect a fix today or tomorrow. I know what's going on.
kennykbplain2011-07-03 08:03:15
allow_comments - 1
Log in (anonymous is fine) to add a comment.