in reply to Problems with number resolution
The math and me! The more illuminated brothers may forgive me. But using Math::BigFloat i get the results you expect:
#!/usr/bin/env perl use strict; use warnings; use Math::BigFloat; use feature qw(say); my $x = Math::BigFloat->new(0); my @nr = ( '32431.19', '20', '-10', '-31800' ); foreach (@nr) { $x += $_; say qq($_\t=>\t$x); } __END__ karls-mac-mini:playground karl$ ./math.pl 32431.19 => 32431.19 20 => 32451.19 -10 => 32441.19 -31800 => 641.19
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems with number resolution
by Laurent_R (Canon) on Jan 02, 2018 at 18:30 UTC |