KJS::SimpleNumber on 64 bit machines

Darin Adler darin at apple.com
Wed Oct 1 17:16:37 CEST 2003


On Wednesday, October 1, 2003, at 03:03 PM, Dirk Mueller wrote:

> Something I wanted to ask before: whats the reason for this dtoa.cpp 
> file
> being in Javascriptcore at all?

The old implementation based on the standard library did work well for 
various edge cases. This broke real-world sites. A test that 
demonstrates this is:

     javascript:alert(9.2)

Before we switched to the dtoa library, this printed 9.19999999. One 
site where we ran into this was Gamespot as of last December. I'm sure 
thorough tests would uncover many other similar problems.

> Is this a Mac specific problem?

Seems unlikely. Mac OS X uses the standard BSD numeric library, not 
something Apple-specific. I believe the fact that standard library 
formatting is not high enough quality for floating point numbers is a 
well known issue; we'd much prefer to use standard library features 
instead of including dtoa.cpp if it was practical.

     -- Darin



More information about the Khtml-devel mailing list