#5981: [with patch, needs review] Sage 3.4.2: prime_pi() broken on 32 bit
----------------------+-----------------------------------------------------
 Reporter:  mabshoff  |       Owner:  mabshoff  
     Type:  defect    |      Status:  assigned  
 Priority:  blocker   |   Milestone:  sage-3.4.2
Component:  doctest   |    Keywords:            
----------------------+-----------------------------------------------------
Changes (by mabshoff):

  * status:  new => assigned


Old description:

> This patch fixes the problem:
> {{{
> diff -r 8713e0a599f3 sage/functions/prime_pi.pyx
> --- a/sage/functions/prime_pi.pyx       Sun May 03 23:10:56 2009 -0700
> +++ b/sage/functions/prime_pi.pyx       Mon May 04 12:44:03 2009 -0400
> @@ -171,7 +171,7 @@
>              raise ValueError, "mem_mult must be positive"
>          if x < 2:
>              return 0
> -        if x > Integer(2**40):
> +        if x > 1099511627776L:
>              raise NotImplementedError, "computation of prime_pi()
> greater 2**40 not implemented"
>          x += x & 1
>          # m_max is the current sieving value, for prime counting - this
> value is sqrt(x)
> }}}

New description:

 The issue is that Integer(2^40) is evaluated to 0 on 32 bit systems (maybe
 due to Cython folding constants?). The attached patch uses a long constant
 instead. Tested to work on 32 and 64 bit boxen.

 Cheers,

 Michael

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5981#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