mirror of
https://github.com/corda/corda.git
synced 2025-01-17 10:20:02 +00:00
Fix a floating point comparison bug - Gets simple SWT examples to work on
Mac OS X
This commit is contained in:
parent
ace36f1b15
commit
a9fcb59e6c
@ -1253,14 +1253,30 @@ interpret(Thread* t)
|
|||||||
float b = popFloat(t);
|
float b = popFloat(t);
|
||||||
float a = popFloat(t);
|
float a = popFloat(t);
|
||||||
|
|
||||||
pushInt(t, (a > b ? 1 : 0));
|
if (a < b) {
|
||||||
|
pushInt(t, static_cast<unsigned>(-1));
|
||||||
|
} else if (a > b) {
|
||||||
|
pushInt(t, 1);
|
||||||
|
} else if (a == b) {
|
||||||
|
pushInt(t, 0);
|
||||||
|
} else {
|
||||||
|
pushInt(t, 1);
|
||||||
|
}
|
||||||
} goto loop;
|
} goto loop;
|
||||||
|
|
||||||
case fcmpl: {
|
case fcmpl: {
|
||||||
float b = popFloat(t);
|
float b = popFloat(t);
|
||||||
float a = popFloat(t);
|
float a = popFloat(t);
|
||||||
|
|
||||||
pushInt(t, (a < b ? 1 : 0));
|
if (a < b) {
|
||||||
|
pushInt(t, static_cast<unsigned>(-1));
|
||||||
|
} else if (a > b) {
|
||||||
|
pushInt(t, 1);
|
||||||
|
} else if (a == b) {
|
||||||
|
pushInt(t, 0);
|
||||||
|
} else {
|
||||||
|
pushInt(t, static_cast<unsigned>(-1));
|
||||||
|
}
|
||||||
} goto loop;
|
} goto loop;
|
||||||
|
|
||||||
case fconst_0: {
|
case fconst_0: {
|
||||||
|
Loading…
Reference in New Issue
Block a user