develooper Front page | perl.perl5.porters | Postings from January 2009

Re: [perl #61754] 'Data::Dumper' reports double value as string.

Thread Previous | Thread Next
From:
Grian
Date:
January 12, 2009 04:21
Subject:
Re: [perl #61754] 'Data::Dumper' reports double value as string.
Message ID:
008b01c974ad$9b3a1910$b502010a@mreserved
Patch for Data::Dumper (Fix decimal printing) 

<grian@cpan.org>

----- Original Message ----- 
From: "reneeb via RT" <perlbug-followup@perl.org>
To: <0body0@rambler.ru>
Sent: Monday, January 12, 2009 12:26 PM
Subject: [perl #61754] 'Data::Dumper' reports double value as string. 


> On Mi. 31. Dez. 2008, 12:47:08, grian wrote:
>> 
>> In last case xs implementation will be more correct
>> 
>> maybe change this string
>>  elsif ($val =~ /^(?:0|-?[1-9]\d{0,8})\z/) { # safe decimal number
>>       $out .= $val;
>>     }
>> on
>>  elsif ($val =~ /^(?:0|-?[1-9]\d{0,8})(?:\.\d*[1-9]\z/) { # safe
>> decimal
>> number
>> 
>> and appropriate change in xs, and tests
>> 
>> I can provide a patch for this change if anybody tell me how do it( I
>> use
>> svn, and may be can use git)
> 
> please provide a unified diff (diff -u <original_version>
> <new_version>). The paths to the files should have the same number of
> slashes (e.g. diff -u file.orig file.new or diff -u dir/file.orig
> dir/file.new).
> 
> Then you can send the diff to this ticket system.
> 
>> 
>> I think differences with perl and xs implementation will be less, and
>> results will be more accurate and nothing will be broken. IMHO
>> 
>
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About