in reply to Re^2: Determining whether a value is zero.
in thread Determining whether a value is zero.

It works as per the OP's spec. Don't blame me for his spec being awful!

For strings,

0+$x; #Upd: Or 1.1 or whatever

is effectively

$x = dualvar(0+$x, $x) if looks_like_number($x);

The OP was clear that dualvar(0, $anything) should be considered zero.

Replies are listed 'Best First'.
Re^4: Determining whether a value is zero.
by choroba (Cardinal) on Mar 11, 2011 at 09:34 UTC
    dualvar 0,"0 " is considered zero after the assignment to $y in my code. That is against the specification I fear...
    UPDATE: corrected.
      No. In fact, after your initial reply, I particular pointed out that your first code incorrectly considers dualvar 0, "0 " to be not be a zero.

      dualvar 0, ANYTHING should be considered a zero.

      "0 " is considered zero after the assignment to $y in my code

      You never test "0 " after the assignment to $y. You test dualvar(0, "0 "). Please re-read my post.

        Oh I see! You are right.