qpqv has asked for the wisdom of the Perl Monks concerning the following question:

i'm using math::bigfloat (subclass of math::bigint?) which is part of the standard module distro for perl 5.8.0 on Solaris8. I'm not using anything like the GMP library (since I couldn't get this sucker to compile). I've run into an interesting quirk. I have a bunch of data files in the same dir, all of which are in the same format (i will triple-check again). My script is setup to process every single file in that dir., but it doesn't. It stops at like the 9th file. Now, if my script stopped processing at that particular file everytime, I could understand that something could be wrong with that particular data file. But that's not what happens. My script can process that 9th file, if I put that file in it's own directory and run the script on that dir. Now, when I say the script doesn't process the 9th file, that means the script still is running (in ptable and I see a CPU pegged at 99+%), but no output. I let it run for a day and still no output. The 9th file is no bigger or smaller than the rest of them, and besides my script can process the first 8 in about 15 sec. And even more interesting is that, when I change the accuracy setting, sometimes my script processes more than 8 files or less depending on that accuracy setting! That is what makes me believe it is a problem with the math::bigfloat. Any ideas?
"In God we trust, all others bring data."
#!/usr/bin/perl use strict; use File::Copy; #use Shell qw(cat); use IO::Handle; use Data::Dumper; #use Math::BigInt; use Math::BigFloat; use Statistics::Lite qw(:all); ...calc... #Math::BigFloat->precision(5); Math::BigFloat->accuracy(4); ## set global accuracy to 4, and get ready to populate %dat my %dat; $dat{"ip"}=$ip; ... ## output %dat to filehandle write my $pathfn=qq($tmpdir/$fn.daily.csv); dat2fhw($pathfn,\%dat); ## set global accuracy back to 6+ Math::BigFloat->accuracy(6); ## loop again on next element

Replies are listed 'Best First'.
Re: math::bigfloat - accuracy quirk - please disregard
by qpqv (Initiate) on Jun 06, 2003 at 17:21 UTC
    woops, please disregard until I do further debugging of the code. I turned on warnings (-w) and I think I know where I "strayed" from the path. I though I had warnings on already, my bad. I pulled a noob!