Re: Dealing with floats and rounding

2008-10-09 Thread Dr.Ruud
Derek Jones schreef:

> All of the common languages suffer from rounding problems inherent in
> IEEE rounding (round-to-even and other issues). Math::Round resolves
> these issues.

If you don't round to even (and your numbers are of the same sign), then
the totals of the original values and the total of the rounded values
will be more different.
That is why round-to-even is also called "bankers rounding", for details
see http://en.wikipedia.org/wiki/Rounding


> $a=4712.5;
>
> $b=round $a;
>
> printf "%s %5.0f %5.0f\n", $a, $a, $b;
>
>
> I hit this while comparing SAS output (which does do proper (within
> machine limits) "mathematical" rounding that we all learned about in
> school. The C libraries from which Perl and other C-lib derived
> languages take their rounding functions are the cause of some
> potential grief here and comparison with 4 other languages vs. SAS
> showed SAS getting it right each time. Using Math::Round - so did
> Perl. We're talking way down to DP as well.
>
> This caused the group I work with some issues as I was rewriting some
> SAS code in Perl and our regression tests were not matching - and we
> were talking adding up millions of rows of data with N DP to be
> concerned about. Math::Round fixed that.

Are you sure that your regression tests were "right"?
:)

-- 
Affijn, Ruud

"Gewoon is een tijger."



Re: Install DBD-Informix on 64bit RHEL

2008-10-09 Thread Jonathan Leffler
On Thu, Oct 9, 2008 at 12:26 AM, Peter J. Holzer <[EMAIL PROTECTED]> wrote:

> On 2008-10-09 10:58:01 +1000, Changcheng Zou wrote:
> > I got a 64bit RHEL running 32bit IDS11(we don't have 32bit IDS). The
> > processor is a Xeon 3000, therefore I believe that 32bit software will
> run.
> > Everything goes fine until we got this DBD-Informix problem. Because the
> > perl is a 64bit version (5.10.0), but the esql is a 32bit. We got error
> > messages as following,
>
> You cannot link a 32 bit library to a 64 bit program (or vice versa).
> You will either have to get the 64bit client libraries of informix
> (assuming the exist) or compile a 32 bit version of perl.
>


Peter is spot on.  And 64-bit CSDK (ESQL/C) should be available.

The only thing that concerns me is that the Makefile.PL is supposed to
detect a mismatch between 64-bit Perl and 32-bit ESQL/C (or vice versa).
Please could you send me (no need to trouble the list) the output of 'perl
-V', and also the full output from 'perl Makefile.PL'.  With luck, that will
allow me to see why you didn't get a sane error message about mixing 32-bit
and 64-bit files.



>
> >
> *--
> >
> > lib/DBD/Informix/Defaults.pm written OK
> > esqlinfo.h written OK
> >
> > Testing whether your Informix test environment will work...
> > /usr/bin/ld: skipping incompatible /opt/ids/lib/esql/libifsql.so when
> > searching for -lifsql
> > /usr/bin/ld: skipping incompatible /opt/ids/lib/esql/libifsql.a when
> > searching for -lifsql
> > /usr/bin/ld: cannot find -lifsql
> >
> *
> >
> >
> > I have no idea what this '-lifsql' is.
>
> "-lifsql" means "link with the "ifsql" library. The linker does find two
> libraries (/opt/ids/lib/esql/libifsql.so and
> /opt/ids/lib/esql/libifsql.a) but both are of the wrong type, so it
> tells you that it cannot use them.
>
>


-- 
Jonathan Leffler <[EMAIL PROTECTED]>  #include 
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."


Re: Install DBD-Informix on 64bit RHEL

2008-10-09 Thread Peter J. Holzer
On 2008-10-09 10:58:01 +1000, Changcheng Zou wrote:
> I got a 64bit RHEL running 32bit IDS11(we don't have 32bit IDS). The
> processor is a Xeon 3000, therefore I believe that 32bit software will run.
> Everything goes fine until we got this DBD-Informix problem. Because the
> perl is a 64bit version (5.10.0), but the esql is a 32bit. We got error
> messages as following,

You cannot link a 32 bit library to a 64 bit program (or vice versa).
You will either have to get the 64bit client libraries of informix
(assuming the exist) or compile a 32 bit version of perl.


> *--
> 
> lib/DBD/Informix/Defaults.pm written OK
> esqlinfo.h written OK
> 
> Testing whether your Informix test environment will work...
> /usr/bin/ld: skipping incompatible /opt/ids/lib/esql/libifsql.so when
> searching for -lifsql
> /usr/bin/ld: skipping incompatible /opt/ids/lib/esql/libifsql.a when
> searching for -lifsql
> /usr/bin/ld: cannot find -lifsql
> *
> 
> 
> I have no idea what this '-lifsql' is.

"-lifsql" means "link with the "ifsql" library. The linker does find two
libraries (/opt/ids/lib/esql/libifsql.so and
/opt/ids/lib/esql/libifsql.a) but both are of the wrong type, so it
tells you that it cannot use them. 

hp

-- 
   _  | Peter J. Holzer| Am Anfang war der Bug und der
|_|_) | Sysadmin WSR   | Verantwortliche sprach:
| |   | [EMAIL PROTECTED]  | Es werde ein Testcase.
__/   | http://www.hjp.at/ |-- Clemens Zauner in dcii


pgpgxiZGpwcgN.pgp
Description: PGP signature