From 926200a1c1e93702b291ae6f271224b2f7ca10b9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 7 Jun 2010 11:08:04 +0200 Subject: i0_analysis: Use "floor" instead of "int" --- scripts/i0-analysis | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/i0-analysis b/scripts/i0-analysis index 1c797139..36fd7a9a 100755 --- a/scripts/i0-analysis +++ b/scripts/i0-analysis @@ -2,6 +2,7 @@ use strict; use File::Basename; +use POSIX; open(FH, $ARGV[0]); @@ -33,7 +34,7 @@ while ( $line = ) { if ( $line =~ /^([\d\.]+)\ ([\d\.]+)$/ ) { my $scale = $1; my $i0 = $2; - my $bin = int(($scale-$hmin)/$hstep); + my $bin = floor(($scale-$hmin)/$hstep); $hist[$bin]++; } } @@ -59,7 +60,7 @@ while ( $line = ) { if ( $line =~ /^([\d\.]+)\ ([\d\.]+)$/ ) { my $scale = $1; my $i0 = $2; - my $bin = int(($i0-$hmin)/$hstep); + my $bin = floor(($i0-$hmin)/$hstep); $hist[$bin]++; } } @@ -85,7 +86,7 @@ while ( $line = ) { if ( $line =~ /^([\d\.]+)\ ([\d\.]+)$/ ) { my $scale = $1; my $i0 = $2; - my $bin = int((($scale/$i0)-$hmin)/$hstep); + my $bin = floor((($scale/$i0)-$hmin)/$hstep); $hist[$bin]++; } } -- cgit v1.2.3