A
aegis
I'm using recursion where I take some given value and a step size
and call the function on itself until the value reaches zero.
The problem is, say I have val = 1, step = .01, then
recursive calls will reduce the value by ~.01, however,
my base case messes up because it never reaches 0.
..1 - .1 ends up being some other double value.
What is a portable way of handling this?
and call the function on itself until the value reaches zero.
The problem is, say I have val = 1, step = .01, then
recursive calls will reduce the value by ~.01, however,
my base case messes up because it never reaches 0.
..1 - .1 ends up being some other double value.
What is a portable way of handling this?