Some code review. Use double literals like
-5.0
rather than
-5
when you are working with doubles. Don't use
while (1==1)
, just use
while(true)
; it's clearer and less error-prone. Consider
var j = (-5.0, 0);
instead of your code. You have
if (j == (1, 1))
. Never test doubles for equality like that. Always assume some inexactness in doubles. Having two very similarly named variables be of diifferent types (
double n1, int n2
) is extremely confusing to the reader —
Flydog57 6 secs ago