Es4-discuss Digest, Vol 12, Issue 30

Mike Cowlishaw MFC at uk.ibm.com
Tue Feb 26 06:33:09 PST 2008


> On Mon, 2008-02-25 at 10:15 +0000, Mike Cowlishaw wrote:
> > Currency calculations are not very interesting at all :-).  But
> > (outside HPC and specialized processors such as graphics cards) they
> > are by far the most common.
> 
> Surely the Adobe fellows have something to say about this :). Flash
> tweening and 3D Flash libraries like Papervision3D make extensive use of
> floating point math. In an environment where tweaks like multiplying
> fixed points instead of dividing yields substantial performance
> increases, the "currency calculations" you speak of fade into
> insignificance.

That's exactly my point.  Currency (and other human-related calculations) 
need to be done in decimal.  Scientific calculations, graphics, etc., need 
to be done in the base that best serves the purpose -- which might be 
decimal if you need high precision hardware and the binary hardware is low 
(double) precision) or it might be binary if you need performance above 
all else (in the short term).

For graphics/drawing calculations, where users are not exposed directly to 
the precise results, binary is just fine.  But for scripting where the 
results of the calculations are seen as numbers, bar charts, etc., by 
users, decimal is necessary.

A case in point -- my PMGlobe app (http://www.cary.demon.co.uk/pmglobe/) 
has to calculate several square roots for every pixel on every refresh -- 
for that it cannot and does not use either binary or decimal 
floating-point, or integer divide (39 cycles, yechh) and still give sub 
0.25-second response, except on today's fastest machines.  But for its 
scripting language it uses Rexx, which has only character-based decimal 
floating-point -- which is more than adequate in speed and exactly 
appropriate in function.

Mike






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









More information about the Es4-discuss mailing list