I need to perform operations with very large numbers like: (-8.3802985809867E + 217 x 4.8047258326981E + 215)
I am programming in PHP a system to solve matrices of linear equations, but being very large numbers it gives me NAN or INF as a result.
I have used the normal module: ($a % $b), also bc_mod and fmod, but neither works for me.
How can I perform operations with very large numbers and also very very small?
You can treat mantissa and exponent separately. Code example for a multiplication:
What is used here is simple school math: powers of ten are multiplied by adding the exponents. However, the result cannot be represented as float. In principle, it is better to look for a suitable class / library.