diff options
author | Piotr Fusik <pfusik@op.pl> | 2005-07-31 14:50:04 +0200 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-08-02 10:39:51 +0000 |
commit | 3c4b39bee8832007b7e91bfce8701d34cacab411 (patch) | |
tree | 190f72b72255db85e5c78f68a0d0047692aab3a9 /lib/Math | |
parent | db30010093a0bacd16d1fa3fd1bd5397da6479d3 (diff) | |
download | perl-3c4b39bee8832007b7e91bfce8701d34cacab411.tar.gz |
Typos in *.p[lm]
From: "Piotr Fusik" <pfusik@op.pl>
Message-ID: <001401c595bd$dccb5d80$0bd34dd5@piec>
p4raw-id: //depot/perl@25261
Diffstat (limited to 'lib/Math')
-rw-r--r-- | lib/Math/BigFloat.pm | 26 | ||||
-rw-r--r-- | lib/Math/BigInt.pm | 44 | ||||
-rw-r--r-- | lib/Math/BigInt/Calc.pm | 8 | ||||
-rw-r--r-- | lib/Math/BigRat.pm | 4 |
4 files changed, 41 insertions, 41 deletions
diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm index 4830618b51..c926de033f 100644 --- a/lib/Math/BigFloat.pm +++ b/lib/Math/BigFloat.pm @@ -204,7 +204,7 @@ sub new $self->{sign} = $$mis; # for something like 0Ey, set y to 1, and -0 => +0 - # Check $$miv for beeing '0' and $$mfv eq '', because otherwise _m could not + # Check $$miv for being '0' and $$mfv eq '', because otherwise _m could not # have become 0. That's faster than to call $MBI->_is_zero(). $self->{sign} = '+', $self->{_e} = $MBI->_one() if $$miv eq '0' and $$mfv eq ''; @@ -2557,7 +2557,7 @@ Math::BigFloat - Arbitrary size floating point math package # The following all modify their first argument. If you want to preserve # $x, use $z = $x->copy()->bXXX($y); See under L<CAVEATS> for why this is - # neccessary when mixing $a = $b assigments with non-overloaded math. + # necessary when mixing $a = $b assignments with non-overloaded math. # set $x->bzero(); # set $i to 0 @@ -2632,7 +2632,7 @@ Math::BigFloat - Arbitrary size floating point math package =head1 DESCRIPTION -All operators (inlcuding basic math operations) are overloaded if you +All operators (including basic math operations) are overloaded if you declare your big floating point numbers as $i = new Math::BigFloat '12_3.456_789_123_456_789E-2'; @@ -2665,7 +2665,7 @@ C</^[+-]\d*\.\d+E[+-]?\d+$/> =back -all with optional leading and trailing zeros and/or spaces. Additonally, +all with optional leading and trailing zeros and/or spaces. Additionally, numbers are allowed to have an underscore between any two digits. Empty strings as well as other illegal numbers results in 'NaN'. @@ -2756,11 +2756,11 @@ supplied to the operation after the I<scale>: Note that C<< Math::BigFloat->accuracy() >> and C<< Math::BigFloat->precision() >> set the global variables, and thus B<any> newly created number will be subject -to the global rounding B<immidiately>. This means that in the examples above, the +to the global rounding B<immediately>. This means that in the examples above, the C<3> as argument to C<bdiv()> will also get an accuracy of B<5>. It is less confusing to either calculate the result fully, and afterwards -round it explicitely, or use the additional parameters to the math +round it explicitly, or use the additional parameters to the math functions like so: use Math::BigFloat; @@ -2844,7 +2844,7 @@ Warning! The accuracy I<sticks>, e.g. once you created a number under the influence of C<< CLASS->accuracy($A) >>, all results from math operations with that number will also be rounded. -In most cases, you should probably round the results explicitely using one of +In most cases, you should probably round the results explicitly using one of L<round()>, L<bround()> or L<bfround()> or by passing the desired accuracy to the math operation as additional parameter: @@ -2904,7 +2904,7 @@ Math::BigInt::Bar, and when this also fails, revert to Math::BigInt::Calc: use Math::BigFloat lib => 'Foo,Math::BigInt::Bar'; Calc.pm uses as internal format an array of elements of some decimal base -(usually 1e7, but this might be differen for some systems) with the least +(usually 1e7, but this might be different for some systems) with the least significant digit first, while BitVect.pm uses a bit vector of base 2, most significant bit first. Other modules might use even different means of representing the numbers. See the respective module documentation for further @@ -2925,7 +2925,7 @@ It is also possible to just require Math::BigFloat: require Math::BigFloat; -This will load the neccessary things (like BigInt) when they are needed, and +This will load the necessary things (like BigInt) when they are needed, and automatically. Use the lib, Luke! And see L<Using Math::BigInt::Lite> for more details than @@ -2971,9 +2971,9 @@ words, Math::BigFloat will try to retain previously loaded libs when you don't specify it onem but if you specify one, it will try to load them. Actually, the lib loading order would be "Bar,Baz,Calc", and then -"Foo,Bar,Baz,Calc", but independend of which lib exists, the result is the +"Foo,Bar,Baz,Calc", but independent of which lib exists, the result is the same as trying the latter load alone, except for the fact that one of Bar or -Baz might be loaded needlessly in an intermidiate step (and thus hang around +Baz might be loaded needlessly in an intermediate step (and thus hang around and waste memory). If neither Bar nor Baz exist (or don't work/compile), they will still be tried to be loaded, but this is not as time/memory consuming as actually loading one of them. Still, this type of usage is not recommended due @@ -3046,7 +3046,7 @@ The following will probably not do what you expect: print $c->bdiv(123.456),"\n"; It prints both quotient and reminder since print works in list context. Also, -bdiv() will modify $c, so be carefull. You probably want to use +bdiv() will modify $c, so be careful. You probably want to use print $c / 123.456,"\n"; print scalar $c->bdiv(123.456),"\n"; # or if you want to modify $c @@ -3096,7 +3096,7 @@ Replacing L<precision> with L<accuracy> is probably not what you want, either: use Math::BigFloat; Math::BigFloat->accuracy(4); # enables global rounding: - my $x = Math::BigFloat->new(123456); # rounded immidiately to "12350" + my $x = Math::BigFloat->new(123456); # rounded immediately to "12350" print "$x\n"; # print "123500" my $y = Math::BigFloat->new(3); # rounded to "3 print "$y\n"; # print "3" diff --git a/lib/Math/BigInt.pm b/lib/Math/BigInt.pm index e40809e4f3..758d7d8b94 100644 --- a/lib/Math/BigInt.pm +++ b/lib/Math/BigInt.pm @@ -727,7 +727,7 @@ sub bzero sub bone { # create a bigint '+1' (or -1 if given sign '-'), - # if given a BigInt, set it to +1 or -1, respecively + # if given a BigInt, set it to +1 or -1, respectively my $self = shift; my $sign = shift; $sign = '+' if !defined $sign || $sign ne '-'; $self = $class if !defined $self; @@ -2264,7 +2264,7 @@ sub objectify # the first argument is number of args objectify() should look at it will # return $count+1 elements, the first will be a classname. This is because # overloaded '""' calls bstr($object,undef,undef) and this would result in - # useless objects beeing created and thrown away. So we cannot simple loop + # useless objects being created and thrown away. So we cannot simple loop # over @_. If the given count is 0, all arguments will be used. # If the second arg is a ref, use it as class. @@ -2683,7 +2683,7 @@ Math::BigInt - Arbitrary size integer/float math package $x->is_inf($sign); # if $x is +inf, or -inf (sign is default '+') $x->is_int(); # if $x is an integer (not a float) - # comparing and digit/sign extration + # comparing and digit/sign extraction $x->bcmp($y); # compare numbers (undef,<0,=0,>0) $x->bacmp($y); # compare absolutely (undef,<0,=0,>0) $x->sign(); # return the sign, either +,- or NaN @@ -2692,7 +2692,7 @@ Math::BigInt - Arbitrary size integer/float math package # The following all modify their first argument. If you want to preserve # $x, use $z = $x->copy()->bXXX($y); See under L<CAVEATS> for why this is - # neccessary when mixing $a = $b assigments with non-overloaded math. + # necessary when mixing $a = $b assignments with non-overloaded math. $x->bzero(); # set $x to 0 $x->bnan(); # set $x to NaN @@ -2783,7 +2783,7 @@ Math::BigInt - Arbitrary size integer/float math package =head1 DESCRIPTION -All operators (inlcuding basic math operations) are overloaded if you +All operators (including basic math operations) are overloaded if you declare your big integers as $i = new Math::BigInt '123_456_789_123_456_789'; @@ -2871,7 +2871,7 @@ appropriate information. even version version number of the class you used 1.61 - div_scale Fallback acccuracy for div + div_scale Fallback accuracy for div 40 trap_nan If true, traps creation of NaN via croak() 1 @@ -2903,7 +2903,7 @@ Warning! The accuracy I<sticks>, e.g. once you created a number under the influence of C<< CLASS->accuracy($A) >>, all results from math operations with that number will also be rounded. -In most cases, you should probably round the results explicitely using one of +In most cases, you should probably round the results explicitly using one of L<round()>, L<bround()> or L<bfround()> or by passing the desired accuracy to the math operation as additional parameter: @@ -3068,7 +3068,7 @@ If used on an object, it will set it to one: $x->is_inf(); # true if +inf $x->is_inf('-'); # true if -inf (sign is default '+') -These methods all test the BigInt for beeing one specific value and return +These methods all test the BigInt for being one specific value and return true or false depending on the input. These are faster than doing something like: @@ -3085,7 +3085,7 @@ C<-inf> is negative. A C<zero> is neither positive nor negative. These methods are only testing the sign, and not the value. -C<is_positive()> and C<is_negative()> are aliase to C<is_pos()> and +C<is_positive()> and C<is_negative()> are aliases to C<is_pos()> and C<is_neg()>, respectively. C<is_positive()> and C<is_negative()> were introduced in v1.36, while C<is_pos()> and C<is_neg()> were only introduced in v1.68. @@ -3340,7 +3340,7 @@ v1.22, while C<as_int()> was only introduced in v1.68. $x->bstr(); -Returns a normalized string represantation of C<$x>. +Returns a normalized string representation of C<$x>. =head2 bsstr @@ -3511,7 +3511,7 @@ versions <= 5.7.2) is like this: result has at most max(scale, length(dividend), length(divisor)) digits Actual code: scale = max(scale, length(dividend)-1,length(divisor)-1); - scale += length(divisior) - length(dividend); + scale += length(divisor) - length(dividend); So for lx = 3, ly = 9, scale = 10, scale will actually be 16 (10+9-3). Actually, the 'difference' added to the scale is calculated from the number of "significant digits" in dividend and divisor, which is derived @@ -3550,7 +3550,7 @@ This is how it works now: * to find out the current global P, use C<< Math::SomeClass->precision() >> * use C<< $x->accuracy() >> respective C<< $x->precision() >> for the local setting of C<< $x >>. - * Please note that C<< $x->accuracy() >> respecive C<< $x->precision() >> + * Please note that C<< $x->accuracy() >> respective C<< $x->precision() >> return eventually defined global A or P, when C<< $x >>'s A or P is not set. @@ -3596,7 +3596,7 @@ This is how it works now: be automatically cleared. * If two objects are involved in an operation, and one of them has A in effect, and the other P, this results in an error (NaN). - * A takes precendence over P (Hint: A comes before P). + * A takes precedence over P (Hint: A comes before P). If neither of them is defined, nothing is used, i.e. the result will have as many digits as it can (with an exception for fdiv/fsqrt) and will not be rounded. @@ -3614,7 +3614,7 @@ This is how it works now: + never round (this is the default): This is done by setting A and P to undef. No math operation will round the result, with fdiv() and fsqrt() as exceptions to guard - against overflows. You must explicitely call bround(), bfround() or + against overflows. You must explicitly call bround(), bfround() or round() (the latter with parameters). Note: Once you have rounded a number, the settings will 'stick' on it and 'infect' all other numbers engaged in math operations with it, since @@ -3734,7 +3734,7 @@ overloading these routines is not possible, this cannot be fixed from BigInt. =item ==, !=, <, >, <=, >= with NaNs BigInt's bcmp() routine currently returns undef to signal that a NaN was -involved in a comparisation. However, the overload code turns that into +involved in a comparison. However, the overload code turns that into either 1 or '' and thus operations like C<< NaN != NaN >> might return wrong values. @@ -3926,7 +3926,7 @@ more time then the actual addition. With a technique called copy-on-write, the cost of copying with overload could be minimized or even completely avoided. A test implementation of COW did show performance gains for overloaded math, but introduced a performance loss due -to a constant overhead for all other operatons. So Math::BigInt does currently +to a constant overhead for all other operations. So Math::BigInt does currently not COW. The rewritten version of this module (vs. v0.01) is slower on certain @@ -4133,7 +4133,7 @@ Additionally, the following still works: There is now a C<bsstr()> method to get the string in scientific notation aka C<1e+2> instead of C<100>. Be advised that overloaded 'eq' always uses bstr() -for comparisation, but Perl will represent some numbers as 100 and others +for comparison, but Perl will represent some numbers as 100 and others as 1e+308. If in doubt, convert both arguments to Math::BigInt before comparing them as strings: @@ -4147,7 +4147,7 @@ comparing them as strings: $y = Math::BigInt->new($y); ok ($x,$y); # okay -Alternatively, simple use C<< <=> >> for comparisations, this will get it +Alternatively, simple use C<< <=> >> for comparisons, this will get it always right. There is not yet a way to get a number automatically represented as a string that matches exactly the way Perl represents it. @@ -4173,7 +4173,7 @@ effect: This also works for other subclasses, like Math::String. -It is yet unlcear whether overloaded int() should return a scalar or a BigInt. +It is yet unclear whether overloaded int() should return a scalar or a BigInt. If you want a real Perl scalar, use C<numify()>: @@ -4203,7 +4203,7 @@ The following will probably not do what you expect: print $c->bdiv(10000),"\n"; It prints both quotient and remainder since print calls C<bdiv()> in list -context. Also, C<bdiv()> will modify $c, so be carefull. You probably want +context. Also, C<bdiv()> will modify $c, so be careful. You probably want to use print $c / 10000,"\n"; @@ -4232,7 +4232,7 @@ manpage), and the equation holds true for any $x and $y, which justifies calling the two return values of bdiv() the quotient and remainder. The only exception to this rule are when $y == 0 and $x is negative, then the remainder will also be -negative. See below under "infinity handling" for the reasoning behing this. +negative. See below under "infinity handling" for the reasoning behind this. Perl's 'use integer;' changes the behaviour of % and / for scalars, but will not change BigInt's way to do things. This is because under 'use integer' Perl @@ -4444,7 +4444,7 @@ Completely rewritten by Tels http://bloodgate.com in late 2000, 2001 - 2004 and still at it in 2005. Many people contributed in one or more ways to the final beast, see the file -CREDITS for an (uncomplete) list. If you miss your name, please drop me a +CREDITS for an (incomplete) list. If you miss your name, please drop me a mail. Thank you! =cut diff --git a/lib/Math/BigInt/Calc.pm b/lib/Math/BigInt/Calc.pm index 4bdd3e6476..856bc0da0f 100644 --- a/lib/Math/BigInt/Calc.pm +++ b/lib/Math/BigInt/Calc.pm @@ -1970,7 +1970,7 @@ Math::BigInt v1.70 or later: _num(obj) returns a Perl integer/floating point number NOTE: because of Perl numeric notation defaults, the _num'ified obj may lose accuracy due to - machine-dependend floating point size limitations + machine-dependent floating point size limitations _add(obj,obj) Simple addition of two objects _mul(obj,obj) Multiplication of two objects @@ -1985,7 +1985,7 @@ Math::BigInt v1.70 or later: are swapped. In this case, the first param needs to be preserved, while you can destroy the second. sub (x,y,1) => return x - y and keep x intact! - _dec(obj) decrement object by one (input is garant. to be > 0) + _dec(obj) decrement object by one (input is guaranteed to be > 0) _inc(obj) increment object by one @@ -2060,11 +2060,11 @@ cases. The first parameter can be modified, that includes the possibility that you return a reference to a completely different object instead. Although keeping -the reference and just changing it's contents is prefered over creating and +the reference and just changing it's contents is preferred over creating and returning a different reference. Return values are always references to objects, strings, or true/false for -comparisation routines. +comparison routines. =head1 WRAP YOUR OWN diff --git a/lib/Math/BigRat.pm b/lib/Math/BigRat.pm index 6243dd4c5a..d18ea07fe9 100644 --- a/lib/Math/BigRat.pm +++ b/lib/Math/BigRat.pm @@ -1440,7 +1440,7 @@ Currently the following replacement libraries exist, search for them at CPAN: =head1 METHODS -Any methods not listed here are dervied from Math::BigFloat (or +Any methods not listed here are derived from Math::BigFloat (or Math::BigInt), so make sure you check these two modules for further information. @@ -1636,7 +1636,7 @@ appropriate information. undef round_mode RW Global round mode even - div_scale RW Fallback acccuracy for div + div_scale RW Fallback accuracy for div 40 trap_nan RW Trap creation of NaN (undef = no) undef |