Skip to content

Commit

Permalink
fix print_n op. stole details from add_n op.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjs committed Jun 4, 2012
1 parent 739fa60 commit 863e308
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/m0/c/m0_ops.c
Expand Up @@ -69,7 +69,7 @@ static void
m0_op_print_n( M0_CallFrame *frame, const unsigned char *ops ) m0_op_print_n( M0_CallFrame *frame, const unsigned char *ops )
{ {
/* note the lack of filehandle selection (ops[1]) for output */ /* 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 static void
Expand Down

5 comments on commit 863e308

@leto
Copy link
Member

@leto leto commented on 863e308 Jun 4, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@kjs
Copy link
Contributor Author

@kjs kjs commented on 863e308 Jun 4, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhuomingliang
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

@kjs kjs commented on 863e308 Jun 5, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kjs: Ok, thanks :P

Please sign in to comment.