float / double support in Python?

Brandon Van Every vanevery at 3DProgrammer.com
Thu Feb 13 15:39:12 EST 2003


Martijn Faassen wrote:
> Brandon Van Every <vanevery at 3dprogrammer.com> wrote:
>>
>> These aren't terribly tricky issues.  It's not like they have
>> radically different encodings or purposes.
>
> You forget the potential loss of accuracy between conversions.

I forget no such thing.  It is simply not a tricky issue.

> Anyway, here we have 6
> things you should be thinking about when dealing with floats versus
> doubles already!

You know, I know this drill.  It is not that hard of a drill.  It's
something that the vast majority of non-numeric programmers can safely
ignore.  Numeric programmers, they're going to have to know the differences
between IEEE 754, IEEE 854, and infinite floating point precision no matter
what the language.

> Most Python programmers are not crossing the Python/C++ boundary that
> often, let alone talking to 3d APIs like DirectX. You're complaining
> as this is
> *your* use case. If Python gave in to everybody's particular use case,
> soon it'll become an awful mess.

If Python doesn't broaden its use cases, it doesn't gain mainstream
acceptance and the language dies, beaten out by things such as Java and C#.

> Calling a 'floating
> point number' a 'float' makes sense, calling them 'double' only makes
> sense if you're coming from C.

No, it makes sense if you're coming from an engineering background and know
the difference between single and double precision in the IEEE 754 and 854
standards.  They're not C specific, they're machine HW standards.  An
ultra-rational fix would be to introduce a "single" and a "double" keyword.

> What is this 'real world' thingy you talk about?

My "real world" contains the IEEE 754 and 854 standards.

> We already had masses of people complaining about this over the years
> in this newsgroup, too. Endless amounts of debating! No, I think
> you're one of the few ever to complain in my memory.. I don't think
> that this shows that most of the "real world"s urgently need this.

Fine.  Remain provincial.  I am getting sick of talking to Python developers
about efficiency, conversion, and high-to-low-level multilanguage transition
issues.  It's clear enough what the dominant Python culture is.

What I'm realizing is that although Python may be the right language for the
novice user AI scripting tasks I originally envisioned, it not an ideal
language for high level 3D graphics coding.  I think I'll begin a search for
something better and see what my options are.

> I wonder what will happen when you discover that Python uses
> indentation for block structure! ;)

I don't know why people assume that partial ignorance is categorical
ignorance.

--
Cheers,                         www.3DProgrammer.com
Brandon Van Every               Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.





More information about the Python-list mailing list