#8896: 0.0000000000000000000000000000 is parsed completely differently than
1.0000000000000000000000000000 for no good reason
--------------------------------+-------------------------------------------
Reporter: was | Owner: AlexGhitza
Type: defect | Status: needs_work
Priority: minor | Milestone: sage-4.4.3
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Comment(by leif):
Replying to [comment:5 kcrisman]:
> Looks okay in general, but the last block
> {{{
> else:
> # Must be 0.00000000000000...0
> sigfigs = len(mantissa)
> }}}
> needs to be indented, n'est pas?
No, the {{{else}}} belongs to the {{{for}}} statement.
But currently, ''leading'' zeros contribute to the precision, too: :)
{{{
sage: RealNumber(0.000000000000000000).prec()
67
sage: RealNumber(00.000000000000000000).prec()
70
sage: RealNumber(.000000000000000000).prec()
64
}}}
I'm not sure if this is intentional, it's at least uncommon.
(And a leading {{{+}}} also increases the precision.)
It looks as if a decimal point is counted as a significant digit.
And, sorry, the code is extremely ugly (not due to the patch) and
inefficient.
Examples and parameter description can be improved as well.
I'm not quite sure what kind of strings actually get in (i.e., where/if
illegal syntax is catched, it seems all is left to {{{RealNumber._set()}}}
if not already handled by the parser), this should perhaps be documented,
too.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8896#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en.