# Revision history [back]

### ContinuedFractions fail on large integers?

I've been doing some work with continued fractions, and when I get to a large enough number, I start hitting an error. For example, with the ContinuedFraction from [(18806263158919164762262694978536817267490601162205305175017345804331141023863425152608922362862834892943764814900901973487239748665085369033027389281788183,), [1, 1, 1, 1, 37612526317838329524525389957073634534981202324410610350034691608662282047726850305217844725725669785887529629801803946974479497330170738066054778563576366]]), I get the error below.

Specifically, I get it after I've created a ContinuedFraction with the arguments above, and then call .value() on it. I've tried to make sure all of those are sage Integer types, but it doesn't seem to help, and it looks like internally the CF code is overflowing somewhere. Is there any way around this, or is this a limitation I'll have to live with?

Thanks for any help!

    Traceback (most recent call last):
self.run()
self._target(*self._args, **self._kwargs)
File "/home/tc/code/cfp/pi/piX/ones.py", line 16, in leeloo
v = ocf.value()
Q = QuadraticField(DD, 'sqrt%d' % DD)
return NumberField(f, name, check=False, embedding=embedding, latex_name=latex_name, **args)
return NumberField_version2(polynomial=polynomial, name=name, check=check, embedding=embedding, latex_name=latex_name, assume_disc_small=assume_disc_small, maximize_at_primes=maximize_at_primes, structure=structure)
x = number_field_morphisms.root_from_approx(polynomial, embedding)
ValueError: Cannot convert NaN or infinity to Pari float

 2 retagged tmonteil 23518 ●25 ●170 ●431 http://wiki.sagemath.o...

### ContinuedFractions fail on large integers?

I've been doing some work with continued fractions, and when I get to a large enough number, I start hitting an error. For example, with the ContinuedFraction from [(18806263158919164762262694978536817267490601162205305175017345804331141023863425152608922362862834892943764814900901973487239748665085369033027389281788183,), [1, 1, 1, 1, 37612526317838329524525389957073634534981202324410610350034691608662282047726850305217844725725669785887529629801803946974479497330170738066054778563576366]]), I get the error below.

Specifically, I get it after I've created a ContinuedFraction with the arguments above, and then call .value() on it. I've tried to make sure all of those are sage Integer types, but it doesn't seem to help, and it looks like internally the CF code is overflowing somewhere. Is there any way around this, or is this a limitation I'll have to live with?

Thanks for any help!

    Traceback (most recent call last):
self.run()
self._target(*self._args, **self._kwargs)
File "/home/tc/code/cfp/pi/piX/ones.py", line 16, in leeloo
v = ocf.value()
Q = QuadraticField(DD, 'sqrt%d' % DD)
return NumberField(f, name, check=False, embedding=embedding, latex_name=latex_name, **args)