in reply to BigFloat Precision

If I recall correctly, BigFloat has no way of knowing how much precision you want, which is why it lets you specify it as part of the interface. I see no calls to a precision method in your code, so you're probably getting some kind of default precision.

Replies are listed 'Best First'.
Re^2: BigFloat Precision
by belg4mit (Prior) on Apr 26, 2005 at 17:22 UTC
    Default precision is "whatever the reult of the math operation is" and hence can grow quite large. Because PDL only offers doubles I tried using BigFloat to fill a Math::Matrix which was then exponentiated to a high power. Without a defined precision the program slowed down for each progressive iteration. Woohoo!

    --
    I'm not belgian but I play one on TV. On dit que je parle comme un belge aussi.

Re^2: BigFloat Precision
by Willman023 (Scribe) on Apr 24, 2005 at 06:47 UTC
    Ok, maybe thats what I don't know how to do. I tried the following pre-division:

    $numerator->precision(999999999999999999999999999999999999999999999999 +99999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999 +99999999999999999999999999999999999999999999999999999); $denominator->precision(9999999999999999999999999999999999999999999999 +99999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999);
    After which the values for numerator and denominator = 0. I tried to set the global precision to this as well, and seemingly everything becomes a NaN. I'm using Perl 5.8 btw, I dunno if that helps.

    Thanks,

    bW