Hello everyone !
I’m building a game in which i have to do physical simulation.
In this game , i’ll have to manipulate huge value (from 10^-15 to 10^15), and i want to use integers.
I cannot afford to use double values, because small errors cumulation could ruin my game.
Thus, I’m considering using a 128 bit integer to handle all the calculations in my physic engine.
Do someone knows the best efficient way (CPU and RAM-wise) to have a “128 integer” in java ?
I just want to do the fallowing operations on this:
- Addition/substraction (often)
- Distance (often)
- operator “greater or equal than”
- operator equal
- Conversion into long / int when no overflow occurs
- Scalar multiplication (with a int or long) (rare)
- Multiplication (rare)
I’m not wanting to use BigInteger because it is not efficient.
Bests Regards,
AM.