Message85747
The process that you describe in msg85741 is a way of ensuring
"memcmp(&x, &y, sizeof(x))==0", and it's portable and safe and is the
Right Thing that we all want and expect. But that's not "x==y", as that
Sun paper explains. It's close, but not technically accurate, as the
implication arrow only goes one way (just as "x=1/y" implies "xy=1" in
algebra, but not the other way around)
I'd be interested to see if you could say that the Python object
model/bytecode interpretation enforces a certain quauntum of operations
that actually does imply "eval(repr(x))==x"; but I suspect it's
unprovable, and it's fragile as Python grows to have more support in
CLI/LLVM/JVM backends.
My pedantic mind would strip any and all references to floating-point
equality out of the docs, as it's dangerous and insidiously misleading,
even in "obvious" cases. But, I'll stop now :) (FYI: I've enjoyed the
~100 messages here.. Great stuff!) |
|
Date |
User |
Action |
Args |
2009-04-07 21:02:04 | jaredgrubb | set | recipients:
+ jaredgrubb, gvanrossum, tim.peters, nascheme, rhettinger, amaury.forgeotdarc, mark.dickinson, eric.smith, christian.heimes, alexandre.vassalotti, noam, preston |
2009-04-07 21:02:03 | jaredgrubb | set | messageid: <1239138123.55.0.585460045597.issue1580@psf.upfronthosting.co.za> |
2009-04-07 21:02:02 | jaredgrubb | link | issue1580 messages |
2009-04-07 21:02:01 | jaredgrubb | create | |
|