in reply to Re^2: Math::BigFloat bnok() question
in thread Math::BigFloat bnok() question

I will try to make a simple example code

Here is a simple demo:
use strict; use warnings; use Math::BigFloat; my $n = Math::BigFloat->new(7); my $k = 5; print $n->bnok($k), "\n"; # prints "21". my $n2 = 7; print $n2->bnok($k); # line 10
It outputs:
21 Can't call method "bnok" without a package or object reference at bnok +.pl line 10.
No problem with the first bnok call, but the second fails because $n2 is not a Math::BigFloat object - and this supports the assertions already made by others in this thread.
Apparently, $k doesn't need to be a Math::BigFloat object (though I think you'll find it can be).

Cheers,
Rob

Replies are listed 'Best First'.
Re^4: Math::BigFloat bnok() question
by azheid (Sexton) on Aug 28, 2015 at 14:53 UTC

    Thanks for your help, this solves my question. I figured out a way around the issue by finding a stand alone subroutine for the calculation and using bignum. The perl gods found a way to idiot proof these large number calculations, and to them I am thankful. Hopefully, another person will find either solution helpful.