I think that float2 may have a bug. It seems to have inaccurate results earlier than it should. There is also a possibility this is just a printing issue. Essentially, I wrote a program with float2 and then with big nat and got different results. I am still very much a beginner so I wouldn't be surprised if something else is wrong.
Float2 version in BQN Repl
BigNat version Note: does not actually run on web repl, requires cbqn
Both of these just copied the needed functions from the related .bqn
files.
The float2 version fails because it generally has slightly off answers that I believe should fit within it's range.
This code and test case comes from a rosalind problem where bignat passes, but float2 fails.
For the current code these are the outputs:
float2 - 353368918335207361428
bignat - 353368918335207375428
2 digits are different here: 61 -> 75
The final value here has 69 binary digits and is the largest number generated, so I don't think there should be any precision loss with float2.