Re: Basic Math Problem

2006-01-04 Thread Tom Phoenix
On 1/3/06, David Newman <[EMAIL PROTECTED]> wrote: > One quick fix here is to use printf instead: > > printf "\n\%02f = %02f", $result, $result; I believe you were doing this to round off "money numbers": numbers with exactly two digits after the decimal point. To do that, you need a slightly dif

Re: Basic Math Problem

2006-01-03 Thread David Newman
On Tue, 3 Jan 2006, Tom Phoenix wrote: On 1/3/06, David Newman <[EMAIL PROTECTED]> wrote: One quick fix here is to use printf instead: printf "\n\%02f = %02f", $result, $result; I believe you were doing this to round off "money numbers": numbers with exactly two digits after the decimal poi

Re: Basic Math Problem

2006-01-03 Thread David Newman
On Tue, 3 Jan 2006, [EMAIL PROTECTED] wrote: $result = 1.00 - 9991.05; print "\n\$result = $result"; The result that is being printed is "8.950073" instead of "8.95". Can someone please tell me why perl acts this way. I am beginning to doubt perl's basic math capabilities.

RE: Re: Basic Math Problem

2006-01-03 Thread Timothy Johnson
y, January 03, 2006 5:47 PM To: 'Dr.Ruud'; beginners@perl.org Subject: RE: Re: Basic Math Problem Also check out 'perldoc perlnumber'. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dr.Ruud Sent: Tuesday, January 03, 2006 5:30 PM To: beginners@pe

RE: Re: Basic Math Problem

2006-01-03 Thread Timothy Johnson
Also check out 'perldoc perlnumber'. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dr.Ruud Sent: Tuesday, January 03, 2006 5:30 PM To: beginners@perl.org Subject: Re: Basic Math Problem [EMAIL PROTECTED] schreef: > printed is "8.950073&qu

Re: Basic Math Problem

2006-01-03 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > printed is "8.950073" > instead of "8.95". perldoc -q numbers -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Basic Math Problem

2006-01-03 Thread Sanbuah
Hello, Here's my problem. I have the following lines coded in my perl program: $result = 1.00 - 9991.05; print "\n\$result = $result"; The result that is being printed is "8.950073" instead of "8.95". Can someone please tell me why perl acts this way. I am beginning to doub