Reputation: 188
I'm trying to do this operation
y = (float) ((-1/1300)*(xsec))+40;
where xsec is x to the second.
With this function double xsec = Math.pow((double)x, 2.0);
and after customized float in this way xsec = (float) xsec;
and y is float.
So when i do the first operation the result is every time 40.0! I checked that xsec change, but even if xsec change the result is the same, 40.0! I suppose that 1/1300 is an operation with too many decimal digits.
How can this happen?
Upvotes: 0
Views: 126