Skip to content

Commit

Permalink
Fixed IO::printd() syscall implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed May 18, 2024
1 parent ee4cad2 commit 43d7912
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/rishka_syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,12 @@ void RishkaSyscall::IO::printn(RishkaVM* vm) {
}

void RishkaSyscall::IO::printd(RishkaVM* vm) {
auto arg = vm->getParam<int64_t>(0);

union {
double output;
int64_t input;
} data;
data.input = arg;
auto arg = rishka_double_to_long(
vm->getParam<int64_t>(0)
);

vm->getTerminal()->print(data.output);
vm->appendToOutputStream(data.output);
vm->getTerminal()->print(arg);
vm->appendToOutputStream(arg);
}

char RishkaSyscall::IO::readch(RishkaVM* vm) {
Expand Down

0 comments on commit 43d7912

Please sign in to comment.