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/