PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

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