ES3.1 Proposal Working Draft

Mike Cowlishaw MFC at
Thu Feb 21 02:46:03 PST 2008

Maciej wrote on Wed Feb 20 14:28:33 PST 2008:

> Besides compatibility issues, this would be a significant performance 
> regression for math-heavy code. I would consider this a showstopper to 
> implementing such a change.

I'm inclined to agree that it is (unfortunately) probably not a good idea 
to simply replace the default binary arithmetic with decimal128 -- even 
though this would give better precision for math applications, as well as 
all the other benefits of decimal arithmetic. 

But I don't buy the performance argument -- decimal math packages are 
respectably fast nowadays.  See, for example, the measurements at -- a decDouble add is a 
couple of hundred cycles in software.  That's roughly the same speed on 
current processors as the hardware binary floating-point available when 
ECMAScript was first written.

In today's (unpipelined) decimal FP hardware it is much faster than those 
software measurements, of course, and there's no reason why future 
implementations should not be within 10%-15% of binary FP.

> I also agree with Mark's comment that arbitrary-precision integers and 
> arbitrary-precision rationals seem like more generally useful types 
> than decimal floating point, if any numeric types are to be added, but 
> that seems like an issue more for ES4 than 3.1.

I really do not understand that comment.  Almost every numerate human 
being on the planet uses decimal arithmetic every day; very few need or 
use arbitrary-precision integers or rationals of more than a few (decimal) 
digits.  And almost every commercial website and server deals with 
currency, prices, and measurements.

It's true that many websites use encryption -- research for which uses 
BigNums extensively -- but websites don't need or use a general-purpose 
integer package for that.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mike Cowlishaw, IBM Fellow
IBM UK (MP8), PO Box 31, Birmingham Road, Warwick, CV34 5JL
mailto:mfc at  --

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

More information about the Es4-discuss mailing list