#4612: [with patch, needs work] is_perfect_power for rationals
------------------------------+---------------------------------------------
 Reporter:  robertwb          |        Owner:  somebody  
     Type:  defect            |       Status:  new       
 Priority:  major             |    Milestone:  sage-3.2.1
Component:  basic arithmetic  |   Resolution:            
 Keywords:                    |  
------------------------------+---------------------------------------------
Changes (by craigcitro):

  * summary:  [with patch, with positive review, needs review of second
              patch] is_perfect_power for rationals => [with
              patch, needs work] is_perfect_power for
              rationals

Comment:

 Actually, I retract my review above. This patch is completely wrong! In
 particular, look at this:

 {{{
 sage: (4/27).is_perfect_power()
 True
 }}}

 That's absolutely not a perfect power! This code is too naive. If both the
 numerator and denominator are perfect powers, we need to see what powers
 they are, and make sure that one of the powers divides the other. Here's a
 battery of tests that needs to pass:

 {{{
  sage: (2/27).is_perfect_power()
  False
  sage: (4/27).is_perfect_power()
  False
  sage: (-1/25).is_perfect_power()
  False
  sage: (-1/27).is_perfect_power()
  True
 }}}

 One might want even more doctests ...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4612#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to