[Haskell-beginners] strange behaviour : computing lowest divisor

Daniel Fischer daniel.is.fischer at googlemail.com
Wed Dec 29 12:49:00 CET 2010


On Wednesday 29 December 2010 10:59:53, Abhijit Ray wrote:
> Thanks, that seems to have fixed it.
>
> On Wed, Dec 29, 2010 at 5:46 PM, Lyndon Maydwell <maydwell at gmail.com> 
wrote:
> > Try with Integer rather than Int. Might be an overflow issue...
> >

> > >
> > > *Main> ld 278970415063349480483707695

Yes, that number is between 2^87 and 2^88, as an Int, it's typically one of
206297903 = 7*37*796517 (32-bit Ints)
or
-9158009321667437777 = -7*13*15015953*670203649 (64-bit Ints).



More information about the Beginners mailing list