How to truncate/round-off decimal numbers?

Nick Maclaren nmm1 at cus.cam.ac.uk
Wed Jun 21 13:45:56 EDT 2006


In article <44997ea8$1 at nntp0.pdx.net>,
Scott David Daniels <scott.daniels at acm.org> writes:
|> Nick Maclaren wrote: (of fixed point)
|> > ....  I am (just) old enough to remember when it was used for
|> > numeric work, and to have used it for that myself, but not old enough
|> > to have done any numeric work using fixed-point hardware.
|> 
|> You are using fixed point hardware today.  Fixed point tracked the
|> "decimal point" (or "binary point" or whatever) in the mind of the
|> programmer, not in the state of the hardware.  There never was
|> "fixed point hardware," it was simply a way of viewing the results
|> of the gates of the same hardware we use today.

Er, no.  Analogue hardware never was fixed-point, and I have used that :-)

More relevantly, you are using a very parochial and unusual interpretation
of the word 'hardware'.  In normal usage, it includes everything below
the instruct set specification (now often called the ABI).  And I can
assure you that there is a considerable difference between the hardware
that provides a floating-point interface at the ABI and that which
provides a fixed-point interface.


Regards,
Nick Maclaren.



More information about the Python-list mailing list