|
|
|
|
|
by thaumasiotes
4540 days ago
|
|
> First, you really don't want to do that division x/y, which is slow, and which fails if y==0. It's much cheaper and safer to compare "abs(x-y) < 1e-10*y". I might be missing something, but won't your cheaper and safer fragment also fail when y is zero (or negative)? |
|
And as you point out, you need to take the abs(y) as well, on the right-hand side.
Thanks for adding clarity.