Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2886 by [email protected]: Float precision
http://code.google.com/p/sympy/issues/detail?id=2886

Some questions about Floats and precisions. I don't know a whole lot about precision tracking, so I'm not sure if these things should be done or not (or if they already are).

- If I create a Float from a string, should it use the default precision (15), or get it from the string? In particular, what should it do when the string has more digits than 15. Right now, it always uses 15, which is confusing (see issue 2878):

In [31]: Float("1.1234567890123456789")
Out[31]: 1.12345678901235

In [32]: Float("1.2")
Out[32]: 1.20000000000000

I'm wondering if it would be a good idea to have the default be prec=None, which would guess the precision from the input.

- How do you get the precision of the Float once it's created. It seems to me that there should be a Float.prec attribute, but there isn't. There is a _prec attribute, but that seems to be some kind of internal precision:

In [33]: Float("1.1234567890123456789")._prec
Out[33]: 53

In [34]: Float("1.2")._prec
Out[34]: 53

In [35]: Float("1.1234567890123456789", 20)._prec
Out[35]: 70

Are these valid concerns, or am I completely misunderstanding how arbitrary precision floating point numbers work?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to