On Sun, Jul 19, 2009 at 03:38, Octavian Râsnita wrote:
> From: "Jim Gibson"
>>
>> PHP is just hiding the inaccuracies of representing decimal fractions
>> using binary numbers, because the inaccuracy is insignificant in most
>> applications.
>
> Well, if it wouldn't be significant, why would PHP h
2009/7/19 Octavian Râşniţă :
> From: "Chas. Owens"
>>
>> What would be the problem if the way of doing calculations by using bignum
>> would be the default?
>> Does it give errors? It would be helpful to know.
>>
>> Octavian
>
>> Because it is slower.
>
> Well, PHP does it faster than Perl, even i
From: "Chas. Owens"
What would be the problem if the way of doing calculations by using bignum
would be the default?
Does it give errors? It would be helpful to know.
Octavian
Because it is slower.
Well, PHP does it faster than Perl, even if it also hide the inaccuracy.
If you want to us
From: "Jim Gibson"
PHP is just hiding the inaccuracies of representing decimal fractions
using binary numbers, because the inaccuracy is insignificant in most
applications.
Well, if it wouldn't be significant, why would PHP hide that inaccuracy as a
default? Why doesn't Perl do the same thin
2009/7/18 Octavian Râşniţă :
> From: "Dr.Ruud"
>>
>> To me that means that you "don't get it" yet.
>
> Oh yes I get it, but I don't like it.
>
> What would be the problem if the way of doing calculations by using bignum
> would be the default?
> Does it give errors? It would be helpful to know.
>
At 4:25 AM +0300 7/19/09, Octavian Râs¸nit¸a wrote:
From: "Dr.Ruud"
To me that means that you "don't get it" yet.
Oh yes I get it, but I don't like it.
No, you don't seem to understand. Perl, PHP, and
all other languages do floating-point arithmetic
using the built-in arithmetic provided
From: "Dr.Ruud"
To me that means that you "don't get it" yet.
Oh yes I get it, but I don't like it.
What would be the problem if the way of doing calculations by using bignum
would be the default?
Does it give errors? It would be helpful to know.
Octavian
--
To unsubscribe, e-mail: begin
Octavian Râşniţă wrote:
It sounds like a limitation of perl because it makes the calculations at
a too low level and not correct the errors automaticly, and not a
limitation of computers in general, because PHP does it right, MS Excel
does it right, the Windows Calculator does it right, so it
Octavian Râşniţă wrote:
Dr.Ruud:
Octavian Rasnita:
print 0.79 - 0.798;
-0.00801
which is obviously wrong.
And it is obvious to me that you are wrong. Funny hey?
Sorry but the calculation is obviously wrong. It is not my fault that
the computers can't make a perfect float cal
> "OR" == Octavian Râşniţă writes:
OR> From: "Uri Guttman"
OR> sorry to say but you still don't get it. automatically rounding numbers
OR> is not higher level NOR correct. there is NO correct way to handle
OR> floating numbers like that. none. nada. it is a very well known issue in
From: "Uri Guttman"
sorry to say but you still don't get it. automatically rounding numbers
is not higher level NOR correct. there is NO correct way to handle
floating numbers like that. none. nada. it is a very well known issue in
ALL programming languages that support floats. some choose conven
> "SHC" == Shawn H Corey writes:
SHC> Uri Guttman wrote:
>> the correct solution for money has always been to use integers
>> for the smallest amount (e.g. cents). this will always be correct in all
>> languanges.
>>
SHC> Sorry, but sometimes you have to use real numbers. On th
Uri Guttman wrote:
the correct solution for money has always been to use integers
for the smallest amount (e.g. cents). this will always be correct in all
languanges.
Sorry, but sometimes you have to use real numbers. On the news,
exchange rates are given to a thousand of a cent, which is OK
> "OR" == Octavian Râşniţă writes:
OR> From: "Shawn H. Corey"
>> Either the programs (not the languages) are doing their calculations
>> in cents, not dollars or they are rounding off at a higher level
>> than Perl. You just think they are not making errors because they're
>> not t
From: "Shawn H. Corey"
Either the programs (not the languages) are doing their calculations in
cents, not dollars or they are rounding off at a higher level than Perl.
You just think they are not making errors because they're not telling you
what they're really doing.
They give a different r
Octavian Râşniţă wrote:
I read it, and it doesn't sound very well:
"Rounding in financial applications can have serious implications, and
the rounding method used should be specified precisely. In these cases,
it probably pays not to trust whichever system rounding is being used by
Perl, but to
Chas. Owens wrote:
Before you go blaming computers, what is the exact value of Pi again?
Understanding the limitations of reality and computers is your job if
you want accurate results.
You can't get accurate results, that's the problem. The questions to
ask are:
* What degree of accuracy
From: "Shawn H. Corey"
Octavian Râşniţă wrote:
Sorry but the calculation is obviously wrong. It is not my fault that the
computers can't make a perfect float calculation with an infinite number
of digits.
But yes, it is not just a fault of perl.
Since all the languages use the same math co-
2009/7/18 Octavian Râşniţă :
> From: "Dr.Ruud"
> Octavian Rasnita wrote:
>>
>>> print 0.79 - 0.798;
>>>
>>> -0.00801
>>>
>>> which is obviously wrong.
>>
>> And it is obvious to me that you are wrong. Funny hey?
>>
>> --
>> Ruud
>
> Sorry but the calculation is obviously wrong. It is n
Octavian Râşniţă wrote:
Sorry but the calculation is obviously wrong. It is not my fault that
the computers can't make a perfect float calculation with an infinite
number of digits.
But yes, it is not just a fault of perl.
Since all the languages use the same math co-processor, they all get i
From: "Dr.Ruud"
Octavian Rasnita wrote:
print 0.79 - 0.798;
-0.00801
which is obviously wrong.
And it is obvious to me that you are wrong. Funny hey?
--
Ruud
Sorry but the calculation is obviously wrong. It is not my fault that the
computers can't make a perfect float calcu
Octavian Rasnita wrote:
print 0.79 - 0.798;
-0.00801
which is obviously wrong.
And it is obvious to me that you are wrong. Funny hey?
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org
sfantar wrote:
> John W. Krahn a écrit :
>>
>> #!/usr/local/bin/perl
>> use strict;
>> use warnings;
>>
>> my @authors;
>> my @titles;
>>
>>
>> for my $file ( @ARGV ) {
>> $file =~ tr/ /_/;
>>
>> my ( $author, $title ) = split /-/, $file;
>>
>> push @authors, $author;
>> push @title
John W. Krahn a écrit :
sfantar wrote:
Hello everyone
Hello,
I would like to be able to print the songs'titles according to the author.
The format of the songs are as follow :
Freda Payne - In motion.mp3
Sylvester - Was it something that i said.mp3
George Benson & A. Franklin - Love All The
sfantar wrote:
> Hello everyone
Hello,
> I would like to be able to print the songs'titles according to the author.
> The format of the songs are as follow :
>
> Freda Payne - In motion.mp3
> Sylvester - Was it something that i said.mp3
> George Benson & A. Franklin - Love All The Hurt Away.mp3
Hello everyone
I would like to be able to print the songs'titles according to the author.
The format of the songs are as follow :
Freda Payne - In motion.mp3
Sylvester - Was it something that i said.mp3
George Benson & A. Franklin - Love All The Hurt Away.mp3
#!/usr/local/bin/perl -w
use s
M Z wrote:
> hello all -
>
> I am trying to do the following to this data:
> input:
> X|YZ||A
>
> desired output:
> X|Y| | | |Z| |A
>
> simply replacing || with | |
> whereever it may occur in the string.
>
> This bit of code doesn't seem to do all of the job.
>
> What is wrong with this code?
Tim Johnson wrote:
>
> I'm not really giving you the answer you're looking for, but here is one way
> to go about it:
>
> while(<>){
> my @temp = split(/\|/,$_);
> foreach my $item(@temp){
> if($item eq ''){
> $item .= ' ';
> }
> }
> print join('|',@temp);
> }
Or you could
CTED]
Sent: Thursday, June 12, 2003 5:28 PM
To: [EMAIL PROTECTED]
Subject: Re: misunderstanding the /g modifier on REGEX
M Z wrote:
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing || with | |
whereever it may occur in
To: [EMAIL PROTECTED]
Subject: Re: misunderstanding the /g modifier on REGEX
M Z wrote:
> hello all -
>
> I am trying to do the following to this data:
> input:
> X|YZ||A
>
> desired output:
> X|Y| | | |Z| |A
>
> simply replacing || with | |
> whereever it may oc
Original Message-
From: M z [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: misunderstanding the /g modifier on REGEX
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing ||
M Z wrote:
> hello all -
>
> I am trying to do the following to this data:
> input:
> X|YZ||A
>
> desired output:
> X|Y| | | |Z| |A
>
> simply replacing || with | |
> whereever it may occur in the string.
>
> This bit of code doesn't seem to do all of the job.
>
> What is wrong with this
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing || with | |
whereever it may occur in the string.
This bit of code doesn't seem to do all of the job.
What is wrong with this code?
while (<>) {
while($_ =~ /([|])([|
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing || with | |
whereever it may occur in the string.
This bit of code doesn't seem to do all of the job.
What is wrong with this code?
while (<>) {
while($_ =~ /([|])([|
Think I figured it out properly.
if ($_ =~ /^\$myquery/) { quotemeta($_); (undef, $line{myquery}) =
split(/=/, $_, 2); }
This gives me MYQUERY = "url=$url&email=$email&i_rank=yes";
If this is not the 'proper' way please let me know of a better way.
Thanks
zack
"Zachary Buckholz" <[EMAIL PROT
I have a bunch of text files that follow the format
variable = value
I am trying to read each file and insert it into SQL but before I can do
that I need to parse
the values into a hash.
One of the fields has the URL which can contain & and = characters, so after
the first split I seem to miss
on Wed, 08 May 2002 20:38:14 GMT, [EMAIL PROTECTED]
(Richard Mr Usarec Buskirk) wrote:
> I fixed my problem:
> [...]
> I have no errors and it works.
I am glad you got it working.
> I am new to cgi but i catch on quickly. Even though i didnt get a
> response to help me.
> I was hoping you guy
37 matches
Mail list logo