Lines Matching refs:accuracy

11 #   _a   : accuracy
27 use vars qw/$round_mode $accuracy $precision $div_scale $rnd_mode
141 $accuracy = undef;
250 sub accuracy
252 # $x->accuracy($a); ref($x) $a
253 # $x->accuracy(); ref($x)
254 # Class->accuracy(); class
255 # Class->accuracy($a); class $a
276 Carp::croak ('Argument to accuracy must be greater than zero');
280 require Carp; Carp::croak ('Argument to accuracy must be an integer');
285 # $object->accuracy() or fallback to global
289 $a = ${"${class}::accuracy"} unless defined $a; # proper return value
293 ${"${class}::accuracy"} = $a; # set global A
300 # $object->accuracy() or fallback to global
302 # but don't return global undef, when $x's accuracy is 0!
303 $r = ${"${class}::accuracy"} if !defined $r;
340 ${"${class}::accuracy"} = undef; # clear global A
372 upgrade downgrade precision accuracy round_mode div_scale/
407 upgrade downgrade precision accuracy round_mode div_scale
417 # select accuracy parameter based on precedence,
502 || (defined ${"${class}::accuracy"})
827 # $a accuracy, if given by caller
858 $a = ${"$c\::accuracy"} unless defined $a;
887 # $a accuracy, if given by caller
918 $a = ${"$c\::accuracy"} unless defined $a;
2053 # accuracy: +$n preserve $n digits from left,
2060 my ($scale,$mode) = $x->_scale_a($x->accuracy(),$x->round_mode(),@_);
2651 $x->round($A,$P,$mode); # round to accuracy or precision using mode $mode
2652 $x->bround($n); # accuracy: preserve $n digits
2686 # precision and accuracy (see section about rounding for more)
2689 $x->accuracy(); # return A of $x (or global, if A of $x undef)
2690 $x->accuracy($n); # set A $x to $n
2694 Math::BigInt->accuracy(); # get/set global A for all BigInt objects
2749 Each of the methods below (except config(), accuracy() and precision())
2751 accuracy, precision and round_mode. Please see the section about
2780 accuracy Global accuracy
2796 upgrade downgrade precision accuracy round_mode div_scale
2802 =head2 accuracy
2804 $x->accuracy(5); # local for $x
2805 CLASS->accuracy(5); # global for all members of CLASS
2806 $A = $x->accuracy(); # read out
2807 $A = CLASS->accuracy(); # read out
2809 Set or get the global or local accuracy, aka how many significant digits the
2816 $x->accuracy(undef);
2817 Math::BigInt->accuracy(undef);
2819 Returns the current accuracy. For C<$x->accuracy()> it will return either the
2820 local accuracy, or if not defined, the global. This means the return value
2821 represents the accuracy that will be in effect for $x:
2824 print Math::BigInt->accuracy(4),"\n"; # set 4, print 4
2827 print $x->accuracy(),"\n"; # will be 4
2828 print $y->accuracy(),"\n"; # also 4, since global is 4
2829 print Math::BigInt->accuracy(5),"\n"; # set to 5, print 5
2830 print $x->accuracy(),"\n"; # still 4
2831 print $y->accuracy(),"\n"; # 5, since global is 5
2842 CLASS->accuracy(5); # global for all members of CLASS
2861 value represents the accuracy that will be in effect for $x:
3145 Round $x to accuracy C<$A> or precision C<$P> using the round mode
3150 $x->bround($N); # accuracy: preserve $N digits
3238 accuracy and precision based rounding, both automatically after every
3241 This section describes the accuracy/precision handling in Math::Big* as it
3251 During the rest of this document, the shortcuts A (for accuracy), P (for
3282 number may have an accuracy greater than the non-zero digits
3298 When both A and P are undefined, this is used as a fallback accuracy when
3382 * fsqrt() simply hands its accuracy argument over to fdiv.
3414 * You can set the A global via C<< Math::BigInt->accuracy() >> or
3415 C<< Math::BigFloat->accuracy() >> or whatever class you are using.
3419 * to undefine A, use C<< Math::SomeCLass->accuracy(undef); >>
3421 * Setting C<< Math::SomeClass->accuracy() >> clears automatically
3427 * to find out the current global A, use C<< Math::SomeClass->accuracy() >>
3429 * use C<< $x->accuracy() >> respective C<< $x->precision() >> for the local
3431 * Please note that C<< $x->accuracy() >> respecive C<< $x->precision() >>
3453 Math::BigInt->accuracy(2);
3454 Math::BigInt::SomeSubClass->accuracy(3);
3540 * You can set A or P locally by using C<< $x->accuracy() >> or
3544 * C<< $x->accuracy() >> clears C<< $x->precision() >>, and vice versa.
3549 fround()/bround() is for accuracy rounding, while ffround()/bfround()
3565 $x->accuracy(5);
3568 Here 4 takes precedence over 5, so 123.5 is the result and $x->accuracy()
3682 Math::BigFloat->accuracy(4); # no more A than 4
3688 Math::BigFloat->accuracy(5); # no more A than 5
3692 print "$y, ",$y->accuracy(),"\n"; # 123.4, 4
3694 Math::BigFloat->accuracy(undef); # A not important now
3829 $accuracy = undef;
3872 as well es preserve accuracy (as in sqrt(3)).