mirror of
https://github.com/corda/corda.git
synced 2025-02-27 11:36:42 +00:00
implement i2d and i2f
This commit is contained in:
parent
b0926e71fb
commit
ce97b6eecb
12
src/run.cpp
12
src/run.cpp
@ -1209,6 +1209,18 @@ run(Thread* t)
|
||||
pushInt(t, static_cast<uint16_t>(popInt(t)));
|
||||
} goto loop;
|
||||
|
||||
case i2d: {
|
||||
double f = static_cast<double>(popInt(t));
|
||||
int64_t i; memcpy(&i, &f, 8);
|
||||
pushLong(t, i);
|
||||
} goto loop;
|
||||
|
||||
case i2f: {
|
||||
float f = static_cast<float>(popInt(t));
|
||||
int32_t i; memcpy(&i, &f, 4);
|
||||
pushInt(t, i);
|
||||
} goto loop;
|
||||
|
||||
case i2l: {
|
||||
pushLong(t, popInt(t));
|
||||
} goto loop;
|
||||
|
Loading…
x
Reference in New Issue
Block a user