Hi. I'd like to ask about your experience with performing +/- operations on numbers that passes over double.MaxValue range. IK i could stick within expotents in range ~630 (sum of double.MaxValue and double.Epsilon expontents to work with normalization) but i decided to overcome these limits and make my incremental gameplay either having way faster progression or being close-to-infinite. So... i came up with this rather trivial implementation of scientific notation:
https://hastebin.com/share/ekituwotin.csharp
then i use DOTS to perform quite safe calculations and accumulate numbers that cannot be added to the overall currency due to too much distance between them. If any1 interested, here's the ECS system for that:
https://hastebin.com/share/ayexotolay.csharp
I have a few questions about that implementation.
- first of all: am i overengineering here?
- is this the proper usage of DOTS? (quite fresh in the topic, so not sure about the "essence" of DOTS) yeah IK thats specifically dots question, but thread fits best under general channel
- I thought i can benefit from inlining some methods, because they are used a lot in most operators, but not sure if i would profit due to variable range loops in there
- any experience with similar design? I didnt find any industry standard that would overcome 600 expotents
- no matemathician here, so some of you can find that Scientific.Number struct amusing. But well.. it works, even with some precision issues, not a big deal tho. Plan to refactor and utilize Log10 in the future perhaps.
Before you ask about out parameters and that weird FixedString conversion function - Burst Compiler was whining about any other approach.
Of course i am aware of BigInteger, though by design my game would operate on multiple "work units" each having its own "big number", so they would eat all my RAM, thats why i try to figure out the alternative.