Currently I am facing a problem where when I multiply two numbers
5e20 * 5e20 = 2.5E41
it overflows from 128 bit
max range that can only contain a maximum number with 39 digits
. So I cannot multiply two very big numbers due to which my precision is reduced. I want precision up to 16
decimal places.
If I perform division of numbers as well
10 / 3 = 3.3333333
I get only 3
because my system doesn't contain floating point so floating part is ignored. In order to achieve the precision, I scale up my dividend by multiplying it 1e16
to get 16 decimal precision.
I also tried to use scientific notation to solve my precision so that I can multiply and divide
2.5/4 or 2.5x4
by writing
25x10^-1
and 4x10^0
but due to this, my multiplication remains in scale-down
format while my division remains in scaled-up
form
2.5/4 = 6.25E16 * 10^-1 (scaled up)
2.5*4 = 100 * 10^-1 (scaled down)
How can I solve this problem? What approach should I use?