Permalink
Browse files

fix print_n op. stole details from add_n op.

  • Loading branch information...
1 parent 739fa60 commit 863e30884e26f05a003f91dde261736a39d2470a @kjs kjs committed Jun 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/m0/c/m0_ops.c
View
2 src/m0/c/m0_ops.c
@@ -69,7 +69,7 @@ static void
m0_op_print_n( M0_CallFrame *frame, const unsigned char *ops )
{
/* note the lack of filehandle selection (ops[1]) for output */
- fprintf( stdout, "%.15g", (unsigned long)frame->registers[ ops[2] ] );
+ fprintf( stdout, "%f", *(double*)&frame->registers[ ops[2] ] );
}
static void

5 comments on commit 863e308

@leto
Parrot Virtual Machine member

Does this make a test pass, or does this still need a test?

@kjs
@zhuomingliang
Parrot Virtual Machine member

kjs: Would you mind if I change '%f' to '%.15g' again, I think that one is more useful. it outputs 1.200000 by using '%f', outputs 1.2 by using '%.15g'.

@kjs

jimmy: no problem. i tried to fix it as it wasn't working well for me. I think it was the casting code that fixed it.

@zhuomingliang
Parrot Virtual Machine member

kjs: Ok, thanks :P

Please sign in to comment.