#8896: 0.0000000000000000000000000000 is parsed completely differently than
1.0000000000000000000000000000 for no good reason
--------------------------------+-------------------------------------------
Reporter: was | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-4.4.3
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Changes (by robertwb):
* status: needs_work => needs_review
Comment:
Replying to [comment:6 leif]:
> No, the {{{else}}} belongs to the {{{for}}} statement.
Exactly.
> 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.
That's the point of this ticket. For 0, all zeros are leading.
> (And a leading {{{+}}} also increases the precision.)
>
> It looks as if a decimal point is counted as a significant digit.
Good catch, fixed. That required some adjustment to keep the input/str in
sync.
> 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.
Updated the docstring a bit. This is mostly for use by the preparser,
though of course it gets used directly as well.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8896#comment:9>
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.