I have a line of code that adds together a few doubles and it give a result of infinity, while the double are all just small but long decimals
a = -1.536709757154733E308
b = 2.102331119338414E156
c = 0.2
d = a - b + (a * c)
d = -1.536709757154733E308 - 2.102331119338414E156 + (-1.536709757154733E308 * 0.2)
d = -infinity
Does anyone know why this is happening? Any help would be much appreciated
PS it is not feasible to use Big Decimals in this code and due to the random 'a' and 'b' change on each run