diff --git a/src/rishka_syscalls.cpp b/src/rishka_syscalls.cpp index b353cf8..61c05c7 100644 --- a/src/rishka_syscalls.cpp +++ b/src/rishka_syscalls.cpp @@ -84,16 +84,12 @@ void RishkaSyscall::IO::printn(RishkaVM* vm) { } void RishkaSyscall::IO::printd(RishkaVM* vm) { - auto arg = vm->getParam(0); - - union { - double output; - int64_t input; - } data; - data.input = arg; + auto arg = rishka_double_to_long( + vm->getParam(0) + ); - vm->getTerminal()->print(data.output); - vm->appendToOutputStream(data.output); + vm->getTerminal()->print(arg); + vm->appendToOutputStream(arg); } char RishkaSyscall::IO::readch(RishkaVM* vm) {