mirror of
https://github.com/corda/corda.git
synced 2025-01-19 11:16:54 +00:00
fix thinkos in d2i and friends
This commit is contained in:
parent
3326aafdac
commit
f05318b787
@ -2094,21 +2094,24 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
||||
frame->pushInt
|
||||
(c->call
|
||||
(c->constant(reinterpret_cast<intptr_t>(doubleToFloat)),
|
||||
Compiler::Indirect, 0, 4, 1, frame->popLong()));
|
||||
Compiler::Indirect, 0, 4, 2,
|
||||
static_cast<Compiler::Operand*>(0), frame->popLong()));
|
||||
} break;
|
||||
|
||||
case d2i: {
|
||||
frame->pushInt
|
||||
(c->call
|
||||
(c->constant(reinterpret_cast<intptr_t>(doubleToInt)),
|
||||
Compiler::Indirect, 0, 4, 1, frame->popLong()));
|
||||
Compiler::Indirect, 0, 4, 2,
|
||||
static_cast<Compiler::Operand*>(0), frame->popLong()));
|
||||
} break;
|
||||
|
||||
case d2l: {
|
||||
frame->pushLong
|
||||
(c->call
|
||||
(c->constant(reinterpret_cast<intptr_t>(doubleToLong)),
|
||||
Compiler::Indirect, 0, 8, 1, frame->popLong()));
|
||||
Compiler::Indirect, 0, 8, 2,
|
||||
static_cast<Compiler::Operand*>(0), frame->popLong()));
|
||||
} break;
|
||||
|
||||
case dadd: {
|
||||
@ -2866,14 +2869,16 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
||||
frame->pushLong
|
||||
(c->call
|
||||
(c->constant(reinterpret_cast<intptr_t>(longToDouble)),
|
||||
Compiler::Indirect, 0, 8, 1, frame->popLong()));
|
||||
Compiler::Indirect, 0, 8, 2,
|
||||
static_cast<Compiler::Operand*>(0), frame->popLong()));
|
||||
} break;
|
||||
|
||||
case l2f: {
|
||||
frame->pushInt
|
||||
(c->call
|
||||
(c->constant(reinterpret_cast<intptr_t>(longToFloat)),
|
||||
Compiler::Indirect, 0, 4, 1, frame->popLong()));
|
||||
Compiler::Indirect, 0, 4, 2,
|
||||
static_cast<Compiler::Operand*>(0), frame->popLong()));
|
||||
} break;
|
||||
|
||||
case l2i:
|
||||
|
@ -32,5 +32,18 @@ public class Floats {
|
||||
expect(divide(0.5d, 0.5d) == 1.0d);
|
||||
|
||||
expect(subtract(0.5d, 0.5d) == 0.0d);
|
||||
|
||||
double d = 1d;
|
||||
expect(((int) d) == 1);
|
||||
|
||||
expect(Math.round(0.4f) == 0);
|
||||
expect(Math.round(0.5f) == 1);
|
||||
expect(Math.round(1.0f) == 1);
|
||||
expect(Math.round(1.9f) == 2);
|
||||
|
||||
expect(Math.round(0.4d) == 0);
|
||||
expect(Math.round(0.5d) == 1);
|
||||
expect(Math.round(1.0d) == 1);
|
||||
expect(Math.round(1.9d) == 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user