Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Integers representing numbers bigger than 20 decimal digits fail double conversion #204

Closed
Ravenwater opened this issue Dec 26, 2020 · 1 comment
Labels
bug good first issue numerical investigation Investigation to explain/quantify numerical properties of a calculation
Milestone

Comments

@Ravenwater
Copy link
Contributor

In generating the tribonacci constant we encounter this:

oracle : 1.8392867552141611325518525646532866004241787460975922467787586394042032220819
612979045863284352 : double(612979045863284359)
    70 : 1.83928675521416096216853475198
1127444240280152704 : double(1127444240280152749)
    71 : 1.83928675521416118421313967701
2073693258389777152 : double(2073693258389777176)
    72 : 1.83928675521416118421313967701
3814116544533214208 : double(3814116544533214284)
    73 : 1.83928675521416118421313967701
7015254043203144704 : double(7015254043203144209)
    74 : 1.83928675521416140625774460204
-5543680227583416320 : double(12903063846126135669)
    75 : -0.790232284311144894672906957567
5285690360152942592 : double(23732434433862494162)
    76 : -0.953462346881624567274116088811
6757264175772670976 : double(43650752323191774040)
    77 : 1.2784071172071358457600354086
6499274308342197248 : double(80286250603180403871)
    78 : 0.961820366834929441068879896193
95484770558259152 : double(147669437360234672073)
    79 : 0.0146916049436009929496371739788

At T(75) the Tribonacci number is 12903063846126135669 but the double conversion incorrectly generates -5543680227583416320.

Hypothesis: that number is 20 digits, which would require 66 bits to represent. Extended precision only has 64 bits. Need to revisit the conversion algorithm.

@Ravenwater Ravenwater added this to the V3 milestone Dec 26, 2020
@Ravenwater Ravenwater changed the title Integers bigger than 20 decimal digits fail double conversion Fixed Integers representing numbers bigger than 20 decimal digits fail double conversion Jan 1, 2021
@Ravenwater Ravenwater added the numerical investigation Investigation to explain/quantify numerical properties of a calculation label Jan 1, 2021
@Ravenwater
Copy link
Contributor Author

fixed in V3.40.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue numerical investigation Investigation to explain/quantify numerical properties of a calculation
Projects
None yet
Development

No branches or pull requests

1 participant