Could someone please have a look? Don't know why this code is not working - the result is always wrong (works only for input -100, 0, 100 and -1, output 0.0).