A use for integer quotients

Bengt Richter bokr at accessone.com
Mon Jul 23 20:35:49 EDT 2001


On Tue, 24 Jul 2001 00:05:12 +0100, Stephen Horne <steve at lurking.demon.co.uk> wrote:

>On Mon, 23 Jul 2001 21:34:51 GMT, bokr at accessone.com (Bengt Richter)
>wrote:
>
>>On Mon, 23 Jul 2001 19:15:33 +0100, Steve Horne <sh at ttsoftware.co.uk> wrote:
>>[...]
>>>
>>>Fixed point arithmetic emulated by using integers with a scale factor,
>>>though, works very nicely. Better still when there's a language
>>>feature to do this automatically, but if we added fixed point types to
>>>Python we'd need *another* division operator - four so far including
>>>the rational one ;-)
>>>
>>This reminds me, is Python configurable to run on a platform with no
>>floating point support?
>
>I believe so - there was even a Python for Psion palmtops at one
>point, and the 3 series certainly doesn't have hardware floats.
>
>All it requires, I imagine, is that the C or C++ (not sure which)
>compiler that you build Python on must have a correctly implemented
>'double' type - the implementation of the floats in software or
>hardware should be irrelevant bar performance concerns.
>
No, I meant really no floating point, including software. What if you had
zero use for floating point, and wanted the benefit of a small footprint?

I wonder if the implementation is factored to where not using floating point
would let you substitute small exception-raising stubs for otherwise large
(?? usually, floating point carries a lot of baggage along in the C/C++ world)
chunks concerned with floating point.

Then that could be a make option. I was wondering if someone's been there done that.

>Linux Python is distributed both as source and as binary, and a source
>distro will compile and install itself with very little fuss if you
>know the basics of Linux. It should just install and work.
>
Yes, no prob.



More information about the Python-list mailing list