I found these :
perl -e'print 01.234 + 01.234', "\n"'
perl -e'print 01.234 + 011.234' "\n"'
perl -e'print 01.234.12 + 01.234', "\n"'

And the results were :

1235234
1235234
1235.12234



Can someone explain it ?

Thanks~~


On Sat, Oct 24, 2009 at 7:28 PM, Peter Scott <pe...@psdt.com> wrote:

> On Wed, 21 Oct 2009 20:52:05 +0800, Majian wrote:
> >             And  I modify it like this "sprintf "The number in
> >             scientific
> > notation is %e", 01.255;"
> >                 The screen now output is " The number in scientific
> >                 notation
> > is 1.255000e+03"
>
> Ha, this is an interesting case.  By putting the zero before the 1, it
> turns it into an octal number and now the period becomes the concatenation
> operator instead of a decimal point, yielding a term of 1255.
>
> Try printf "The number in scientific notation is %e", 037.255"; and see
> what happens.
>
> --
> Peter Scott
> http://www.perlmedic.com/
> http://www.perldebugged.com/
> http://www.informit.com/store/product.aspx?isbn=0137001274
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to