Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-07-03
08:02 • Closed ticket [3349934fff]: Incorrect rounding converting bignum to double p... artifact: 2ca6259cb2 user: kennykb
01:01 • New ticket [3349934fff]. artifact: d210cbac53 user: kennykb

Incorrect rounding converting bignum to double

Closed / Fixed3349934fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-07-03 01:01:50
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:02:28
allow_comments - 1
Log in (anonymous is fine) to add a comment.