yes - this is VERY off topic for a mod_perl mailing list. remember, computers are binary machines. your 323.82 was not stored like you might think. the computer approximated using binary math. when you scaled it four places to the left, you saw the results of the approximation. FreeBSD appears more accurate on this particular calculation, but it might be less so with different input.
check out one of the Math:: packages on CPAN, you should be able to find something that will give you the accuracy required for your application. Vlad Safronov wrote: > While testing my perl scripts I found a strange bug that happens only on > Linux (RH 6.2, 7.0), > See the code below. Before your read the all text, tell me what's the Buffer > value? > "3238200"? The answer is NO! Try this example on your Linux box > > SOURCE test.c: > -=-=-=-= > #include <stdio.h> > #include <stdlib.h> > > main () { > double Sum, ResultSum; > ResultSum = 10000; > Sum = 323.82; > char *Buffer = new char[255]; > sprintf(Buffer, "%d", (long)(Sum * ResultSum)); > printf("Buffer = [%s], Sum = %.4f, Sum * Result = %.4f\n", Buffer, Sum, (Sum > * ResultSum)); > > return 0; > } > > RESULTS > -=-=-=-= > now compile on Linux RedHat 6.2 with gcc version egcs-2.91.66 19990314/Linux > (egcs-1.1.2 release) > Output: > $ g++ test.c > $ ./a.out > Buffer = [3238199], Sum = 323.8200, Sum * Result = 3238200.0000 > -=-=-=-= > > the Buffer value is very strange! I have no ideas how Buffer can be 3238199! > FreeBSD (old 3.x) works well and Buffer=3238200 as it should be, but on > Linux 6.2, 7.0 it is 3238199.. -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/