I'm curious whence the "RuntimeError: Floating point exception,"
perhaps I should just go look at the code...

On Tue, Mar 5, 2013 at 5:02 PM, William Stein <wst...@gmail.com> wrote:
> On Tue, Mar 5, 2013 at 10:55 AM, Robert Bradshaw
> <rober...@math.washington.edu> wrote:
>> On Tue, Mar 5, 2013 at 7:39 AM, David Loeffler
>> <d.a.loeff...@warwick.ac.uk> wrote:
>>> On 5 March 2013 06:54, Peng Tian <tianpeng.ch...@gmail.com> wrote:
>>>> Dear David,
>>>> You are right. I tried to change the data type of the code in sage, which 
>>>> is
>>>> "int" type in the source code of SAGE and now I'm using "long int" instead.
>>>> The previous error is gone and everything is working well now.
>>>>
>>>> Thanks a lot!
>>>>
>>>> Best regards!
>>>> Peng
>>>>
>>>
>>> Dear Peng,
>>>
>>> Using long ints is a sound temporary fix, I guess. It would have the
>>> side-effect of making the small N cases slightly slower and more
>>> memory-hungry, so it might be best to have two separate functions in
>>> the code, one using ints and the other longs, and choose between them
>>> according to whether N^2 > 2^{31} or not; we already do similar things
>>> for some other related functions, e.g lift_to_sl2z(). You could even
>>> write a patch for this and upload it to Sage's trac server; then
>>> that'll prevent anyone else having this problem in the future.
>>>
>>> In an ideal world we'd also want a third implementation that uses MPIR
>>> arbitrary-precision integers; this will be necessary when N is
>>> *really* big, i.e. N^2 > 2^{63}. But I suspect that nobody's going to
>>> be calculating Heilbronn matrices for such big N for a long while yet.
>>
>> Looking at the original error "RuntimeError: Floating point exception"
>> does raise some concerns about blindly switching to long int; if
>> there's floating point involved all ints can be represented exactly as
>> doubles, but not all longs. I have not, however, looked at at the code
>
> There's no floating point.  I wrote this code in 2004, and it was some
> of the first
> Cython (Pyrex at the time) code I wrote... and it was back when computers were
> pretty much all 32-bit.
>
> William
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to