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 +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4