$y->{sign} =~ tr/+-/-+/;
# continue with normal div code:
- # make copy of $x in case of list context for later reminder calculation
+ # make copy of $x in case of list context for later remainder calculation
if (wantarray && $y_not_one)
{
$rem = $x->copy();
sub bmod
{
- # (dividend: BFLOAT or num_str, divisor: BFLOAT or num_str) return reminder
+ # (dividend: BFLOAT or num_str, divisor: BFLOAT or num_str) return remainder
# set up parameters
my ($self,$x,$y,$a,$p,$r) = (ref($_[0]),@_);
# negative amount?
return $x->blsft($y->copy()->babs(),$n) if $y->{sign} =~ /^-/;
- # the following call to bdiv() will return either quo or (quo,reminder):
+ # the following call to bdiv() will return either quo or (quo,remainder):
$x->bdiv($n->bpow($y),$a,$p,$r,$y);
}
print $c->bdiv(123.456),"\n";
-It prints both quotient and reminder since print works in list context. Also,
+It prints both quotient and remainder since print works in list context. Also,
bdiv() will modify $c, so be careful. You probably want to use
print $c / 123.456,"\n";
if (($x->is_nan() || $y->is_nan()) ||
($x->is_zero() && $y->is_zero()));
- # +-inf / +-inf == NaN, reminder also NaN
+ # +-inf / +-inf == NaN, remainder also NaN
if (($x->{sign} =~ /^[+-]inf$/) && ($y->{sign} =~ /^[+-]inf$/))
{
return wantarray ? ($x->bnan(),$self->bnan()) : $x->bnan();
$x = $mbf->new(100) / 3;
is ($x->{_a}, undef); is ($x->{_p}, undef);
-# result & reminder
+# result & remainder
$x = $mbf->new(100) / 3; ($x,$y) = $x->bdiv(3);
is ($x->{_a}, undef); is ($x->{_p}, undef);
is ($y->{_a}, undef); is ($y->{_p}, undef);