#26156 closed defect (fixed)

0.0 is printed with too many digits

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.7
Component: user interface Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: a5911da (Commits) Commit: a5911dafeebbb480301ab6b34980b0f93b722102
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

sage: RR(0).str(digits=3)
'0.000'

This is trivial to fix, but then it causes hundreds of doctest failures since every real zero is printed with one less digit. To compensate for this, we add one extra digit for 0.0 in the default case.

Change History (10)

comment:1 Changed 15 months ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/26156

comment:2 Changed 15 months ago by git

  • Commit set to 39ca504876f8bab2deee709cccd78ef087aea92a

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

39ca504Print 0.0 with the correct number of digits

comment:3 Changed 15 months ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Description modified (diff)

comment:4 Changed 15 months ago by git

  • Commit changed from 39ca504876f8bab2deee709cccd78ef087aea92a to e26788a1a8bbe3b1b8cc49d77376094cce6b3e0f

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

e26788aPrint 0.0 with the correct number of digits

comment:5 Changed 15 months ago by jdemeyer

  • Status changed from new to needs_review

comment:6 Changed 11 months ago by git

  • Commit changed from e26788a1a8bbe3b1b8cc49d77376094cce6b3e0f to a5911dafeebbb480301ab6b34980b0f93b722102

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a5911daPrint 0.0 with the correct number of digits

comment:7 Changed 11 months ago by jdemeyer

  • Dependencies #26154 deleted
  • Milestone changed from sage-8.4 to sage-8.7

comment:8 follow-up: Changed 11 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

It is a little annoying to have that one special case just to make this less of a patchbomb. However, we can always address that on a later ticket as it is the precedent.

comment:9 in reply to: ↑ 8 Changed 11 months ago by jdemeyer

Replying to tscrim:

It is a little annoying to have that one special case just to make this less of a patchbomb. However, we can always address that on a later ticket as it is the precedent.

On the other hand, do you really care whether it's 0.000000000000000 or 0.00000000000000? What's important is that the number of digits is correct when you specifically ask for a given number of digits.

comment:10 Changed 11 months ago by vbraun

  • Branch changed from u/jdemeyer/ticket/26156 to a5911dafeebbb480301ab6b34980b0f93b722102
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.