Made to Order Software Corporation Logo

Equal (typed)

SWF Action
Action Category: 
Comparisons
Action Details: 
(typed)
Action Identifier: 
73
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 2 (a), push 1 (b)
Action Operation: 
a1 := pop();
a2 := pop();
if(is_int(a1) && is_int(a2)) {
  i1 := (int)a1;
  i2 := (int)a2;
  r := i2 == i1;    // compare integers
}
else if(is_numeric(a1) && is_numeric(a2)) {
  f1 := (float)a1;
  f2 := (float)a2;
  r := f2 == f1;    // compare floating points, likely to always return false!
}
else {
  s1 := (string)a1;
  s2 := (string)a2;
  r := s2 == s1;    // compare characters, case sensitive
}
push(r);
Action Flash Version: 
5

Pop two integers, floats or strings, compute whether they are equal and push the Boolean result back on the stack.

The != operator can be simulated using the Logical Not action right after the Equal (typed).

If a mix set of types is popped from the stack, conventional conversions occur. Strings may be transformed to numbers and numbers to strings as with the untyped Equal operator.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.