Ticket #6171 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[with patch, positive review] make 'prec' work with sqrt more of the time

Reported by: jhpalmieri Owned by: jhpalmieri
Priority: minor Milestone: sage-4.0.1
Component: algebra Keywords:
Cc: Work issues:
Report Upstream: Reviewers: Mike Hansen
Authors: John Palmieri Merged in: 4.0.1.alpha0
Dependencies: Stopgaps:

Description

Before this patch:

sage: sqrt(10.1, prec=100)
...
TypeError: sqrt() got an unexpected keyword argument 'prec'

This is despite the fact that the docstring for sqrt lists as one of its inputs

            -  ``prec`` - integer (default: None): if None, returns
               an exact square root; otherwise returns a numerical square root if
               necessary, to the given bits of precision.

After this patch:

sage: sqrt(10.1, prec=100)
3.1780497164141406804582045589
sage: sqrt(10.1, prec=200)
3.1780497164141406804582045589354800553656236461562686475080

Attachments

sqrt.patch Download (1.6 KB) - added by jhpalmieri 4 years ago.

Change History

comment:1 Changed 4 years ago by was

  • Summary changed from [with patch, needs review] make 'prec' work with sqrt more of the time to [with patch, needs work] make 'prec' work with sqrt more of the time

Please add doctests to the patch illustrating that it fixes the bug.

comment:2 Changed 4 years ago by jhpalmieri

  • Summary changed from [with patch, needs work] make 'prec' work with sqrt more of the time to [with patch, needs review] make 'prec' work with sqrt more of the time

Please add doctests to the patch illustrating that it fixes the bug.

Yes, sorry about that. I was just sitting down to produce a new patch when I saw this comment. Here's a new patch.

Changed 4 years ago by jhpalmieri

comment:3 Changed 4 years ago by mhansen

  • Status changed from new to closed
  • Resolution set to fixed
  • Summary changed from [with patch, needs review] make 'prec' work with sqrt more of the time to [with patch, positive review] make 'prec' work with sqrt more of the time

Looks good to me.

Merged in 4.0.1.alpha0.

comment:4 Changed 4 years ago by mvngu

  • Reviewers set to Mike Hansen
  • Merged in set to 4.0.1.alpha0
  • Authors set to John Palmieri
Note: See TracTickets for help on using tickets.