Am 15.01.2012 19:17, schrieb Christophe BAL:
What is the implementation of floats ? Is it the traditional one with
maximum sizes for the mantisse and the exponent ?
If it is, it is not true that float are decimal or even base-2 numbers.
Why, because a fixed size of the mantisse implies some approximations.
Integral multiples of some power of 2, such as 2, 1, 0.5, 0.25, and
0.125, are not approximate.
In general, I do not understand what you mean by "does not exist,
mathematically".
IEEE floating-point arithmetic certainly is a mathematical structure, so
each floating-point number does exist, mathematically - it's just not a
real number. (It's not even rational number if you get to the fringe
cases, because associativity may fail.)
This is not the same implementation for the Python module decimal which
keeps exact representation, if it can.
Floats do the same.
I mean: they keep the exact representation, if they can.
(IEEE float has been designed to do that even in some cases where you
wouldn't expect it to, e.g. 1.0/3.0*1.0 will be exactly 1.0. Actually
this will work for any divisor that can be represented exactly.)
Regards,
Jo
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.