Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Well, won't give away everything. The key is to minimize rounding errors. You don't need Numpy or anything but 'normal' Python.
did you find a solution? im running into the same problem
+1 clever congratulations 👏
New challenges help us to increase our knowledge and make better algorithms. Congrats 👏
Don't forget to upvote if you liked it.
😁
This comment is hidden because it contains spoiler information about the solution
Haha I just saw all the comments already! Well, it's the gift of reading lots of comments/questions on katas I suppose ;)
Numpy is a great tool. Specially if you've got to deal to lot of calculations very often. But Python itself has an incredible advantage, its integer precision that remains intact with only three arithmetic operators, not division (unless you use integer division). With Numpy, many calculation follow the float precision road, not the integer one. Hope that this helps.
@benjaminzwhite. You've got a special gift. You had seen it before it happened. :)
Yeah, I tested some numpy.datatypes and I get always 762096994298999808, as I do with 'normal' python floats, which is afaik a hardware specific.
Using numpy.float64 I got 762096994298999936 for the same test, still not good enough
Have the same issue as ofersadan85. It seems that there a rounding issues with very large inputs. I guess I have to use a specific data type like numpy.float64