WYSIWYG decimal fractions (RE: [Python-Dev] Minutes from the Numeric Coercion dev-day session)

Greg Ewing greg@cosc.canterbury.ac.nz
Thu, 15 Mar 2001 13:47:12 +1300 (NZDT)


Maybe Python should use decimal FP as the *default* representation
for fractional numbers, with binary FP available as an option for
those who really want it.

Unadorned FP literals would give you decimal FP, as would float().
There would be another syntax for binary FP literals (e.g. a 'b'
suffix) and a bfloat() function.

My first thought was that binary FP literals should have to be
written in hex or octal. ("You want binary FP? Then you can jolly
well learn to THINK in it!") But that might be a little extreme.

By the way, what if CPU designers started providing decimal FP 
in hardware? Could scientists and ordinary mortals then share the
same FP system and be happe? The only disadvantage I can think of 
for the scientists is that a bit more memory would be required, but
memory is cheap nowadays. Are there any other drawbacks that
I haven't thought of?

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+