On Monday 02 June 2008 12:27:17 Bernhard Schmalhofer wrote:

> The behavior of
>
> .sub main
>
>   $N0 = 3.14159
>   say $N0
>   print $N0
>   print "\n"
> .end
>
> surprised me, as I got:
>
>
> [EMAIL PROTECTED]:~/devel/Parrot/trunk$ uname -a
> Linux heist 2.6.24-17-generic #1 SMP Thu May 1 14:31:33 UTC 2008 i686
> GNU/Linux
> [EMAIL PROTECTED]:~/devel/Parrot/trunk$ ./parrot t.pir
> 3.14159
> 3.141590
>
> Why should 'print' print trailing a '0' and 'say' not?

The print opcode calls PIO_printf with a format of %f, while the say 
pseudo-opcode calls the say method on a ParrotIO PMC and Parrot converts the 
N-register argument into a string by some other means.  This happens in 
src/inter_call.c, in convert_arg_from_num(), which calls string_from_num() in 
src_string.c with a format of %vg.

They should probably be consistent, but changing either of them to match the 
other causes test failures (though they all look superficial).

-- c

Reply via email to