aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-07 11:08:04 +0200
committerThomas White <taw@physics.org>2010-06-07 11:08:04 +0200
commit926200a1c1e93702b291ae6f271224b2f7ca10b9 (patch)
tree1463a0b9bd1c1de3349da0aefdcbedfaeb0b3162 /scripts
parent997b02dbf9b458a7831a3b74bb21265f3b82996a (diff)
i0_analysis: Use "floor" instead of "int"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/i0-analysis7
1 files changed, 4 insertions, 3 deletions
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 = <FH> ) {
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 = <FH> ) {
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 = <FH> ) {
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]++;
}
}