sybperl-l Archive
Up Prev Next
From: SA Lim <salim at epax02 dot fairchildsemi dot com>
Subject: real number problem
Date: Jul 25 2000 9:43AM
Hi,
I have an app that reads a real number as 0.899999976158142.
Using isql returns 0.900000. I am using Perl 5.005_03 and
Sybperl 2.11 on Solaris 2.6.
Code snippet:
$sql_query = "select * from $TABLE where LOT_NBR='$lot'";
$dbh->ct_execute("$sql_query");
open(OUTFILE, ">$DATAFILE");
while ($dbh->ct_results($restype) == CS_SUCCEED) {
next unless $dbh->ct_fetchable($restype);
while (@row = $dbh->ct_fetch) {
$i = 0;
foreach (@row) {
print OUTFILE "$i : $_\n";
$i++;
}
}
}
close OUTFILE;
Any ideas? TIA.
SA Lim
|