# - fixed nulled leave with live enter in sort { }
# - fixed reference constants (\"str")
# - handle empty programs gracefully
-# - handle infinte loops (for (;;) {}, while (1) {})
+# - handle infinite loops (for (;;) {}, while (1) {})
# - differentiate between `for my $x ...' and `my $x; for $x ...'
# - various minor cleanups
# - moved globals into an object
# - added support for Ilya's OPpTARGET_MY optimization
# - elided arrows before `()' subscripts when possible
# Changes between 0.59 and 0.60
-# - support for method attribues was added
+# - support for method attributes was added
# - some warnings fixed
# - separate recognition of constant subs
-# - rewrote continue block handling, now recoginizing for loops
+# - rewrote continue block handling, now recognizing for loops
# - added more control of expanding control structures
# Changes between 0.60 and 0.61 (mostly by Robin Houston)
# - many bug-fixes
# 'use warnings; BEGIN {${^WARNING_BITS} eq "U"x12;} use warnings::register'
# op/getpid 2 - can't assign to shared my() declaration (threads only)
# 'my $x : shared = 5'
-# op/override 7 - parens on overriden require change v-string interpretation
+# op/override 7 - parens on overridden require change v-string interpretation
# 'BEGIN{*CORE::GLOBAL::require=sub {}} require v5.6'
# c.f. 'BEGIN { *f = sub {0} }; f 2'
# op/pat 774 - losing Unicode-ness of Latin1-only strings
Lexical (my) variables declared in scopes external to a subroutine
appear in code2ref output text as package variables. This is a tricky
-problem, as perl has no native facility for refering to a lexical variable
+problem, as perl has no native facility for referring to a lexical variable
defined within a different scope, although L<PadWalker> is a good start.
=item *
use warnings;
use strict;
BEGIN {
- # BEGIN block is acutally a subroutine :-)
+ # BEGIN block is actually a subroutine :-)
return unless $] > 5.009;
require feature;
feature->import(':5.10');
}
####
# SKIP ?$] < 5.010 && "state vars not implemented on this Perl version"
-# state vars in anoymous subroutines
+# state vars in anonymous subroutines
$a = sub {
state $x;
return $x++;
DOLLAR_UNDERSCORE: {
# Warn on uses of $_ with a few exceptions. I'm not warning on
- # $_ inside grep, map, or statement modifer foreach because
+ # $_ inside grep, map, or statement modifier foreach because
# they localize $_ and it'd be impossible to use these
# features without getting warnings.
=item *
-Since the path seperators are different on some operating systems ('/'
+Since the path separators are different on some operating systems ('/'
on Unix, ':' on MacPerl, etc...) we recommend you use the File::Spec
modules wherever portability is a concern.
# Split up paths
- # igonore $path's volume
+ # ignore $path's volume
my ( $path_dirs, $path_file ) = ($self->splitpath($path))[1,2] ;
# ignore $base's file part
if ($unix_mode) {
- # Fix up mixed syntax imput as good as possible - GIGO
+ # Fix up mixed syntax input as good as possible - GIGO
$path = unixify($path) if $path_vms;
$dir = unixify($dir) if $dir_vms;
return $self->SUPER::canonpath($rslt);
} else {
- #with <> posible instead of [.
+ #with <> possible instead of [.
# Normalize the brackets
# Fixme - need to not switch when preceded by ^.
$path =~ s/</\[/g;
$dir =~ s/</\[/g;
$dir =~ s/>/\]/g;
- # Fix up mixed syntax imput as good as possible - GIGO
+ # Fix up mixed syntax input as good as possible - GIGO
$path = vmsify($path) if $path_unix;
$dir = vmsify($dir) if $dir_unix;
# Assume VMS mode
if (($spath_unix == $spath_vms) &&
($file_unix == $file_vms)) {
- # Ambigous, so if in $unix_rpt mode then assume UNIX.
+ # Ambiguous, so if in $unix_rpt mode then assume UNIX.
$unix_mode = 1 if $unix_rpt;
} else {
$unix_mode = 1
$rslt = $spath;
$file = unixify($file) if ($file_vms);
- # Unix merge may need a directory delimitor.
+ # Unix merge may need a directory delimiter.
# A null path indicates root on Unix.
$rslt .= '/' unless ($rslt =~ m#/$#);
}
}
return $self->canonpath($rslt) unless $unix_rpt;
- # In Unix report mode, do not strip off redundent path information.
+ # In Unix report mode, do not strip off redundant path information.
return $rslt;
}
my $skip_exception = "Install VMS::Filespec (from vms/ext)" ;
if ( $@ ) {
- # Not pretty, but it allows testing of things not implemented soley
+ # Not pretty, but it allows testing of things not implemented solely
# on VMS. It might be better to change File::Spec::VMS to do this,
# making it more usable when running on (say) Unix but working with
# VMS paths.
is($before, $after, "cwd() shouldn't create spurious entries in %ENV");
}
-# XXX force Cwd to bootsrap its XSUBs since we have set @INC = "../lib"
+# XXX force Cwd to bootstrap its XSUBs since we have set @INC = "../lib"
# XXX and subsequent chdir()s can make them impossible to find
eval { fastcwd };
=item 2.08 (7 December 1997)
-Glob dumps don't output superflous 'undef' anymore.
+Glob dumps don't output superfluous 'undef' anymore.
Fixes from Gisle Aas <gisle@aas.no> to make Dumper() work with
overloaded strings in recent perls, and his new testsuite.
if (!val)
return 0;
- /* If the ouput buffer has less than some arbitary amount of space
+ /* If the ouput buffer has less than some arbitrary amount of space
remaining, then enlarge it. For the test case (25M of output),
*1.1 was slower, *2.0 was the same, so the first guess of 1.5 is
deemed to be good enough. */
#
# This is the exact equivalent of Dump. Well, almost. The things that are
# different as of now (due to Laziness):
-# * doesnt do double-quotes yet.
+# * doesn't do double-quotes yet.
#
void
# a package with a freeze() which dies
package Test3;
sub new { bless({name => $_[1]}, $_[0]) }
-sub freeze { die "freeze() is broked" }
+sub freeze { die "freeze() is broken" }
=item C<usageOnly>
-rudimentally per-package memory usage dump. If set,
+rudimentary per-package memory usage dump. If set,
C<dumpvars> calculates total size of strings in variables in the package.
=item unctrl
get unique file name for checking for compiler
[Jens Rehsack]
- - Code base modernization and substantial code coverage improvments
+ - Code base modernization and substantial code coverage improvements
[Jim Keenan]
0.2703 - Tue Mar 16 17:10:55 EDT 2010
somehow never got into this copy. [Steve Hay]
- Added a new 'defines' parameter to compile(), which gives a
- platform-independant way to specify various -Dfoo=bar (or the
+ platform-independent way to specify various -Dfoo=bar (or the
equivalent) compiler defines. [Randy W. Sims]
0.14 Mon Sep 19 13:40:37 CDT 2005
1.49
-Turns out that the new can_write_dir.t doesnt work properly under root
+Turns out that the new can_write_dir.t doesn't work properly under root
as root can read the files regardless as to their mode. So we skip those
tests when the effective UID is 0 indicating root.
"Going to try to rename it to '$tmp'.\n";
if ( rename $file, $tmp ) {
- warn "Rename succesful. Scheduling '$tmp'\nfor deletion at reboot.\n";
+ warn "Rename successful. Scheduling '$tmp'\nfor deletion at reboot.\n";
# when $installing we can set $moan to true.
# IOW, if we cant delete the renamed file at reboot its
# not the end of the world. The other cases are more serious
_move_file_at_boot( $tmp, $file );
return $tmp;
} else {
- _choke("Rename failed:$!", "Cannot procede.");
+ _choke("Rename failed:$!", "Cannot proceed.");
}
}
Wrapper around File::Copy::copy to handle errors.
-If $verbose is true and >1 then additional dignostics will be emitted.
+If $verbose is true and >1 then additional diagnostics will be emitted.
If $dry_run is true then the copy will not actually occur.
];
#restore the original directory we were in when File::Find
- #called us so that it doesnt get horribly confused.
+ #called us so that it doesn't get horribly confused.
_chdir($save_cwd);
}, $current_directory );
_chdir($cwd);
Remove shadowed files. If $ignore is true then it is assumed to hold
a filename to ignore. This is used to prevent spurious warnings from
-occuring when doing an install at reboot.
+occurring when doing an install at reboot.
We now only die when failing to remove a file that has precedence over
our own, when our install has precedence we only warn.
use MakeMaker::Test::Setup::BFD;
BEGIN { use_ok('ExtUtils::Install') }
-# ensure the env doesnt pollute our tests
+# ensure the env doesn't pollute our tests
local $ENV{EU_INSTALL_ALWAYS_COPY};
local $ENV{EU_ALWAYS_COPY};
' UNINST=0 left different' );
}
-# Test UNINST=1 only warning when failing to remove an irrelevent shadow file
+# Test UNINST=1 only warning when failing to remove an irrelevant shadow file
{
my $tfile='install-test/lib/perl/Big/Dummy.pm';
local $ExtUtils::Install::Testing = $tfile;
}
-# Test UNINST=1 dieing when failing to remove an relevent shadow file
+# Test UNINST=1 dieing when failing to remove an relevant shadow file
{
my $tfile='install-test/lib/perl/Big/Dummy.pm';
local $ExtUtils::Install::Testing = $tfile;
ok( chdir File::Spec->updir );
ok( teardown_recurs(), 'teardown' );
}
-# ensure the env doesnt pollute our tests
+# ensure the env doesn't pollute our tests
local $ENV{EU_INSTALL_ALWAYS_COPY};
local $ENV{EU_ALWAYS_COPY};
' UNINST=0 left different' );
}
-# Test UNINST=1 only warning when failing to remove an irrelevent shadow file
+# Test UNINST=1 only warning when failing to remove an irrelevant shadow file
{
my $tfile='install-test/lib/perl/Big/Dummy.pm';
local $ExtUtils::Install::Testing = $tfile;
}
-# Test UNINST=1 dieing when failing to remove an relevent shadow file
+# Test UNINST=1 dieing when failing to remove an relevant shadow file
{
my $tfile='install-test/lib/perl/Big/Dummy.pm';
local $ExtUtils::Install::Testing = $tfile;
- On Win32, there was a DLL file we create during testing that we
couldn't delete unless we closed it first, so testing failed when
- the deletiong was attempted. This should now work (provided the
+ the deletion was attempted. This should now work (provided the
version of perl is high enough to have DynaLoader::dl_unload_file()
- I'm not sure what will happen otherwise). [Steve Hay]
# Now do a block of some sort.
$condnum = 0;
- $cond = ''; # last CASE: condidional
+ $cond = ''; # last CASE: conditional
push(@line, "$END:");
push(@line_no, $line_no[-1]);
$_ = '';
# 0: type, 1: with_size, 2: how, 3: how_size
if ($t and not $t->[1] and $t->[0] eq 'p') {
- # PUSHp corresponds to setpvn. Treate setpv directly
+ # PUSHp corresponds to setpvn. Treat setpv directly
my $what = eval qq("$t->[2]");
warn $@ if $@;
}
sub UNTIE {
- # This sub does nothing, but is neccessary for references to be released.
+ # This sub does nothing, but is necessary for references to be released.
}
sub end_marker {
=item B<hiertype>
-Retains C<::> in type names so that C++ hierachical types can be
+Retains C<::> in type names so that C++ hierarchical types can be
mapped. Default is false.
=item B<except>
* Silence VC++ compiler warnings
* IO::Socket's IO.xs fails to compile
* IO::Socket::connect returns wrong errno on timeout
- * Coverity correctly reports that gv might (just) be NULL. So don't derefernece it if it is.
+ * Coverity correctly reports that gv might (just) be NULL. So don't dereference it if it is.
* Simplify tests for fork() capabilities
* Fix syntax error in io_pipe test
* Making IO::Socket pass test on Win32
Mon Oct 13 1997 <gbarr@pobox.com> (Graham Barr)
IO.xs, IO::Handle
- - 1.17 broke compatability with 5.003, small tweaks to restore
- compatability
+ - 1.17 broke compatibility with 5.003, small tweaks to restore
+ compatibility
t/io_const.t
- - Added new test to ensure backwards compatability with constants
+ - Added new test to ensure backwards compatibility with constants
is not broken
Wed Oct 8 1997 <gbarr@pobox.com> (Graham Barr)
o IO::Handle
- Removed use of AutoLoader for constants, constants are
now defined as constant XS subs
- - Added fsync, but will not be avaliable for use
+ - Added fsync, but will not be available for use
unless HAS_FSYNC is defined, perls configure does not define
this yet.
- Moved bootstrap of IO.xs to IO.pm. IO::Handle no longer
o IO.xs
- Patched IO.xs with patch from Chip for setvbuf warning
- - Added XS sub "constant" for backwards compatability
+ - Added XS sub "constant" for backwards compatibility
o Misc
- Fixed IO::Socket::configure, it was not passing $arg to domain
specific package
- Changed all $fh variables in IO::Handle to $io and all $fh
variables in IO::Socket to $sock as Chip suggested
- - Fixed usage messages to be consistant
+ - Fixed usage messages to be consistent
*** Release 1.15
o Modified IO.xs so that DESTROY gets called on IO::File
objects that were created with IO::File->new_tmpfile
o Modified the domain2pkg code in IO::Socket so that it
- does not use blessd refs
+ does not use blessed refs
o Created a new package IO::Pipe::End so that pipe specific
stuff can be moved out of IO::Handle.
o Added Ilya's OS/2 changes to Pipe.pm and io_pipe.t
- o These changes happened somtime before the release of 1.15
+ o These changes happened sometime before the release of 1.15
- added shutdown to IO::Socket
- modified connect to not use alarm
- modified accept and connect to use IO::Select
return ioctl($io, $op, $_[2]);
}
-# this sub is for compatability with older releases of IO that used
-# a sub called constant to detemine if a constant existed -- GMB
+# this sub is for compatibility with older releases of IO that used
+# a sub called constant to determine if a constant existed -- GMB
#
# The SEEK_* and _IO?BF constants were the only constants at that time
# any new code should just chech defined(&CONSTANT_NAME)
goto POST_SOCKET;
}
-@a = $sel->can_read(); # should return imediately
+@a = $sel->can_read(); # should return immediately
print "not " unless @a == 0;
print "ok 10\n";
### interrupted by eof calls.
### On perl-5.7.0@7673 this failed in a SOCKS environment, because eof
### did an getc followed by an ungetc in order to check for the streams
- ### end. getc(3) got replaced by the SOCKS funktion, which ended up in
+ ### end. getc(3) got replaced by the SOCKS function, which ended up in
### a recv(2) call on the socket, while ungetc(3) put back a character
### to an IO buffer, which never again was read.
#
Locale::Maketext::Guts::_compile() when working with tainted values
Fix for CPAN RT #34182: Don't localize $@.
- ->maketext calls will now backup and restore $@ so that die messages are not supressed.
+ ->maketext calls will now backup and restore $@ so that die messages are not suppressed.
Fix for CPAN RT #55461
%hash deprecated messages cleaned up with perl 5.12
en_*.pm. Thanks to Robert Spier for spotting this. Test added.
So don't use v1.07!
- * Autrijus found some typoes in the TPJ article. Fixed.
+ * Autrijus found some typos in the TPJ article. Fixed.
2004-01-11 Sean M. Burke sburke@cpan.org
test.pl.
2001-06-20 Sean M. Burke sburke@cpan.org
- * Release 1.02: EBCDIC-compatability changes courtesy of Peter
+ * Release 1.02: EBCDIC-compatibility changes courtesy of Peter
Prymmer. Added [*,...] as alias for [quant,...] and [#,...] as an
alias for [numf,...]. Added some more things to test.pl
# tabs screw everything up!
$pointy = substr($_[0],0,$pos);
$pointy =~ tr/\t //cd;
- # make everything into whitespace, but preseving tabs
+ # make everything into whitespace, but preserving tabs
$pointy .= "^=== near there\n";
}
}
use Number::Format;
- # can be overriden according to language conventions
+ # can be overridden according to language conventions
sub _numf_params {
return (
-thousands_sep => '.',
match any files in any directories", although he says the last part
about "in any directories" should probably just be left off.
-You wonder how you'll get gettext to handle this; to accomodate the
+You wonder how you'll get gettext to handle this; to accommodate the
ways Arabic, Chinese, and Italian deal with numbers in just these few
very simple phrases, you need to write code that will ask gettext for
different queries depending on whether the numerical values in
depending on whether the user is male or female; so the Arabic
translation "your[feminine] query" is applicable in fewer cases than
the corresponding English phrase, which doesn't distinguish the user's
-gender. (In practice, it's not feasable to have a program know the
+gender. (In practice, it's not feasible to have a program know the
user's gender, so the masculine "you" in Arabic is usually used, by
default.)
the UK English localization module I<only> those phrases that are
UK-specific, and for all the rest, I<inherit> from the American
English module. (And I expect this same situation would apply with
-Brazilian and Continental Portugese, possbily with some I<very>
+Brazilian and Continental Portugese, possibly with some I<very>
closely related languages like Czech and Slovak, and possibly with the
slightly different "versions" of written Mandarin Chinese, as I hear exist in
Taiwan and mainland China.)
As to sharing of auxiliary functions, consider the problem of Russian
numbers from the beginning of this article; obviously, you'd want to
write only once the hairy code that, given a numeric value, would
-return some specification of which case and number a given quanitified
+return some specification of which case and number a given quantified
noun should use. But suppose that you discover, while localizing an
interface for, say, Ukranian (a Slavic language related to Russian,
spoken by several million people, many of whom would be relieved to
from the Russian module, just for the sake of inheriting all the
various grammatical methods. Or, probably better organizationally,
you could move those functions to a module called C<_E_Slavic> or
-something, which Russian and Ukranian could inherit useful functions
+something, which Russian and Ukrainian could inherit useful functions
from, but which would (presumably) provide no lexicon.
=head2 Buzzword: Concision
"Your search expression was malformed."
-is somewhat of a degerate case, and just gets turned into:
+is somewhat of a degenerate case, and just gets turned into:
sub { return "Your search expression was malformed." }
That is all covered in the documentation for Locale::Maketext and the
modules that come with it, available in CPAN. After having read this
article, which covers the why's of Maketext, the documentation,
-which covers the how's of it, should be quite straightfoward.
+which covers the how's of it, should be quite straightforward.
=head2 The Proof in the Pudding: Localizing Web Sites
RETURN_MORTAL_INT(-1); /* len differs: X < Y */
}
/* both have same number of elements, so check length of last element
- and see if it differes */
+ and see if it differs */
tempx = *av_fetch(array_x, elemsx, 0); /* fetch last element */
tempy = *av_fetch(array_y, elemsx, 0); /* fetch last element */
SvPV(tempx, lenx); /* convert to string & store length */
Original math code by Mark Biggar, rewritten by Tels L<http://bloodgate.com/>
in late 2000.
-Seperated from BigInt and shaped API with the help of John Peacock.
+Separated from BigInt and shaped API with the help of John Peacock.
Fixed, sped-up and enhanced by Tels http://bloodgate.com 2001-2003.
Further streamlining (api_version 1 etc.) by Tels 2004-2007.
$x = $C->_new("12"); is ($C->_str($C->_fac($x)),'479001600');
$x = $C->_new("13"); is ($C->_str($C->_fac($x)),'6227020800');
-# test that _fac modifes $x in place for small arguments
+# test that _fac modifies $x in place for small arguments
$x = $C->_new("3"); $C->_fac($x); is ($C->_str($x),'6');
$x = $C->_new("13"); $C->_fac($x); is ($C->_str($x),'6227020800');
sub bmodpow
{
# takes a very large number to a very large exponent in a given very
- # large modulus, quickly, thanks to binary exponentation. Supports
+ # large modulus, quickly, thanks to binary exponentiation. Supports
# negative exponents.
my ($self,$num,$exp,$mod,@r) = objectify(3,@_);
$x->bmod($y); # modulus ($x % $y)
$x->bpow($y); # power of arguments ($x ** $y)
- $x->bmodpow($exp,$mod); # modular exponentation (($num**$exp) % $mod))
+ $x->bmodpow($exp,$mod); # modular exponentiation (($num**$exp) % $mod))
$x->blsft($y, $n); # left shift by $y places in base $n
$x->brsft($y, $n); # right shift by $y places in base $n
# returns (quo,rem) or quo if in scalar context
# Round $self according to given parameters, or given second argument's
# parameters or global defaults
- # for speed reasons, _find_round_parameters is embeded here:
+ # for speed reasons, _find_round_parameters is embedded here:
my ($self,$a,$p,$r,@args) = @_;
# $a accuracy, if given by caller
{
$self->bfround(int($p),$r) if !defined $self->{_p} || $self->{_p} <= $p;
}
- # bround() or bfround() already callled bnorm() if nec.
+ # bround() or bfround() already called bnorm() if nec.
$self;
}
{
# (BINT or num_str, BINT or num_str) return BINT
# does not modify arguments, but returns new object
- # GCD -- Euclids algorithm, variant C (Knuth Vol 3, pg 341 ff)
+ # GCD -- Euclid's algorithm, variant C (Knuth Vol 3, pg 341 ff)
my $y = shift;
$y = $class->new($y) if !ref($y);
sub bmodpow
{
# takes a very large number to a very large exponent in a given very
- # large modulus, quickly, thanks to binary exponentation. Supports
+ # large modulus, quickly, thanks to binary exponentiation. Supports
# negative exponents.
my ($self,$num,$exp,$mod,@r) = objectify(3,@_);
# invalid input.
my $x = shift;
- # strip white space at front, also extranous leading zeros
+ # strip white space at front, also extraneous leading zeros
$x =~ s/^\s*([-]?)0*([0-9])/$1$2/g; # will not strip ' .2'
$x =~ s/^\s+//; # but this will
$x =~ s/\s+$//g; # strip white space at end
$x->bmuladd($y,$z); # $x = $x * $y + $z
$x->bmod($y); # modulus (x % y)
- $x->bmodpow($exp,$mod); # modular exponentation (($num**$exp) % $mod))
- $x->bmodinv($mod); # the multiplicative inverse of $x modulo $mod
+ $x->bmodpow($exp,$mod); # modular exponentiation (($num**$exp) % $mod)
+ $x->bmodinv($mod); # the inverse of $x in the given modulus $mod
$x->bpow($y); # power of arguments (x ** y)
$x->blsft($y); # left shift in base 2
=head2 bmodpow()
- $num->bmodpow($exp,$mod); # modular exponentation
+ $num->bmodpow($exp,$mod); # modular exponentiation
# ($num**$exp % $mod)
Returns the value of C<$num> taken to the power C<$exp> in the modulus
-C<$mod> using binary exponentation. C<bmodpow> is far superior to
+C<$mod> using binary exponentiation. C<bmodpow> is far superior to
writing
$num ** $exp % $mod
integer like 123 (or 120). A precision of 2 means two digits to the left
of the decimal point are zero, so 123 with P = 1 becomes 120. Note that
numbers with zeros before the decimal point may have different precisions,
-because 1200 can have p = 0, 1 or 2 (depending on what the inital value
+because 1200 can have p = 0, 1 or 2 (depending on what the initial value
was). It could also have p < 0, when the digits after the decimal point
are zero.
assumption that 124 has 3 significant digits, while 120/7 will get you
'17', not '17.1' since 120 is thought to have 2 significant digits.
The rounding after the division then uses the remainder and $y to determine
- wether it must round up or down.
+ whether it must round up or down.
? I have no idea which is the right way. That's why I used a slightly more
? simple scheme and tweaked the few failing testcases to match it.
}
# set lowest parts to 0
while ($dst >= 0) { $x->[$dst--] = 0; }
- # fix spurios last zero element
+ # fix spurious last zero element
splice @$x,-1 if $x->[-1] == 0;
$x;
}
#!/usr/bin/perl -w
-# test rounding, accuracy, precicion and fallback, round_mode and mixing
+# test rounding, accuracy, precision and fallback, round_mode and mixing
# of classes under BareCalc
use strict;
-123456E-2:-1234.56
1e1:10
2e-11:0.00000000002
-# excercise _split
+# exercise _split
.02e-1:0.002
000001:1
-00001:-1
$x = $C->_new("12"); is ($C->_str($C->_fac($x)),'479001600');
$x = $C->_new("13"); is ($C->_str($C->_fac($x)),'6227020800');
-# test that _fac modifes $x in place for small arguments
+# test that _fac modifies $x in place for small arguments
$x = $C->_new("3"); $C->_fac($x); is ($C->_str($x),'6');
$x = $C->_new("13"); $C->_fac($x); is ($C->_str($x),'6227020800');
84696969696969696943434343434871161616161616161452525252486813131313131313143230042929292929292930:13131313131313131313131313131394949494949494949494949494943535353535353535353535:6449999999999999998
84696969696969696969696969697497424242424242424242424242385803030303030303030300750000000000000000:13131313131313131313131313131394949494949494949494949494943535353535353535353535:6450000000000000000
84696969696969696930303030303558030303030303030057575757537318181818181818199694689393939393939395:13131313131313131313131313131394949494949494949494949494943535353535353535353535:6449999999999999997
-# excercise shortcut for numbers of the same length in div
+# exercise shortcut for numbers of the same length in div
999999999999999999999999999999999:999999999999999999999999999999999:1
999999999999999999999999999999999:888888888888888888888888888888888:1
999999999999999999999999999999999:777777777777777777777777777777777:1
$ans = eval $try;
is ( $ans, "1427247692705959881058285969449495136382746624");
-# test wether Math::BigInt::Scalar via use works (w/ dff. spellings of calc)
+# test whether Math::BigInt::Scalar via use works (w/ dff. spellings of calc)
$try = "use $class ($version,'lib','Scalar');";
$try .= ' $x = 2**10; $x = "$x";';
$ans = eval $try; is ( $ans, "1024");
-# test rounding, accuracy, precicion and fallback, round_mode and mixing
+# test rounding, accuracy, precision and fallback, round_mode and mixing
# of classes
# Make sure you always quote any bare floating-point values, lest 123.46 will
}
###############################################################################
-# test wether operations round properly afterwards
-# These tests are not complete, since they do not excercise every "return"
+# test whether operations round properly afterwards
+# These tests are not complete, since they do not exercise every "return"
# statement in the op's. But heh, it's better than nothing...
$x = $mbf->new('123.456');
#!/usr/bin/perl -w
-# test rounding, accuracy, precicion and fallback, round_mode and mixing
+# test rounding, accuracy, precision and fallback, round_mode and mixing
# of classes
use strict;
#!/usr/bin/perl -w
-# test rounding, accuracy, precicion and fallback, round_mode and mixing
+# test rounding, accuracy, precision and fallback, round_mode and mixing
# of classes
use strict;
+4294967296:+32:1
+281474976710656:+48:1
+2:-2:NaN
-# excercise base 10
+# exercise base 10
-1234:0:10:-1234
+1234:0:10:1234
+200:2:10:2
# The following hash values are used:
# sign : +,-,NaN,+inf,-inf
# _d : denominator
-# _n : numeraotr (value = _n/_d)
+# _n : numerator (value = _n/_d)
# _a : accuracy
# _p : precision
# You should not look at the innards of a BigRat - use the methods for this.
package Math::BigRat;
-# anythig older is untested, and unlikely to work
+# anything older is untested, and unlikely to work
use 5.006;
use strict;
use Carp ();
$len = $x->length();
-Return the length of $x in digitis for integer values.
+Return the length of $x in digits for integer values.
=head2 digit()
print $x->bstr(),"\n"; # prints 1/2
print $x->bsstr(),"\n"; # prints 1/2
-Return a string representating this object.
+Return a string representing this object.
=head2 bacmp()/bcmp()
-123456E-2:-1234.56
1e1:10
2e-11:0.00000000002
-# excercise _split
+# exercise _split
.02e-1:0.002
000001:1
-00001:-1
'1000000000000000000000000000000000000000/1732050807568877293527446341505872366943',
'bsqrt(1/3)');
-# all tests successfull
+# all tests successful
1;
- Fix from Mark Fowler - XSLoader is autogenerated too
1.9 22nd April 2003
- - incorported PodMaster's corelist script
+ - incorporated PodMaster's corelist script
1.8 13th February 2003
- reformatted Changes file to use makereadme
- Can now select device for udp and icmp protocols.
Patch by sarfata@altern.org (Thomas Sarlandie).
- Add new "syn" protocol to allow for mass parallel
- (syncronous) TCP service reachability checking.
+ (synchronous) TCP service reachability checking.
- Add ack() method to utilize non-blocking connect
(SYN/ACK) feature of the "syn" protocol.
- Add demo/fping script as a "syn" demonstration.
- - Compatibiliy patches for cygwin.
+ - Compatibility patches for cygwin.
Spot by frazee.23@osu.edu (Joseph Frazee)
2.20 Jun 20 10:00 2002
purposes, undef and 0 and can be treated as the same case. In array
context, the elapsed time as well as the string form of the ip the
host resolved to are also returned. The elapsed time value will
-be a float, as retuned by the Time::HiRes::time() function, if hires()
+be a float, as returned by the Time::HiRes::time() function, if hires()
has been previously called, otherwise it is returned as an integer.
=item $p->source_verify( { 0 | 1 } );
} else {
$^W = 0;
# The average user just has no reason to be seeing
- # $^W-suppressable warnings from the the require!
+ # $^W-suppressible warnings from the the require!
}
eval "require $c";
} else {
$^W = 0;
# The average user just has no reason to be seeing
- # $^W-suppressable warnings from the formatting!
+ # $^W-suppressible warnings from the formatting!
}
eval { $formatter->parse_from_file( $file, $out_fh ) };
use File::Spec::Functions qw(catfile);
use Tk;
-die join '', __PACKAGE__, " doesn't work nice with Tk.pm verison $Tk::VERSION"
+die join '', __PACKAGE__, " doesn't work nice with Tk.pm version $Tk::VERSION"
if $Tk::VERSION eq '800.003';
BEGIN { eval { require Tk::FcyEntry; }; };
use Safe 1.00;
-my $last_test; # initalised at end
+my $last_test; # initialised at end
print "1..$last_test\n";
my $t = 1;
use Safe 1.00;
-my $last_test; # initalised at end
+my $last_test; # initialised at end
print "1..$last_test\n";
# Set up a package namespace of things to be visible to the unsafe code
my $t = 30;
$! = 0;
-my $nosuch = '/non/existant/file.name';
+my $nosuch = '/non/existent/file.name';
open(NOSUCH, $nosuch);
if ($@) {
my $errno = $!;
(bless[],"Foo")->isa("Foo");
!);
-is( $r, "pwned", "isa overriden in compartment" );
+is( $r, "pwned", "isa overridden in compartment" );
is( (bless[],"Foo")->isa("Foo"), 1, "... but not outside" );
sub Foo::foo {}
(bless[],"Foo")->can("foo");
!);
-is( $r, "pwned", "can overriden in compartment" );
+is( $r, "pwned", "can overridden in compartment" );
is( (bless[],"Foo")->can("foo"), \&Foo::foo, "... but not outside" );
$r = $c->reval(q!
The bug was introduced as development perl change 16442 (on
2002/05/07), so has been present since 2.00.
Patches to introduce more regression tests to reduce the chance of
- a reoccurance of this sort of goof are always welcome.
+ a reoccurence of this sort of goof are always welcome.
Thu May 30 20:31:08 BST 2002 Nicholas Clark <nick@ccl4.org>
5.6.x introduced the ability to have IVs as long long. However,
Configure still defined BYTEORDER based on the size of a long.
Storable uses the BYTEORDER value as part of the header, but
- doesn't explicity store sizeof(IV) anywhere in the header.
+ doesn't explicitly store sizeof(IV) anywhere in the header.
Hence on 5.6.x built with IV as long long on a platform that
uses Configure (ie most things except VMS and Windows) headers
are identical for the different IV sizes, despite the files
changed my e-mail to pobox.
- mentionned it is not thread-safe.
+ mentioned it is not thread-safe.
updated version number.
scalars tagged as being an lvalue are handled as if they were
not an lvalue at all. Added test for that LVALUE bug workaround.
- Now handles Perl immortal scalars explicitely, by storing &sv_yes
- as such, explicitely.
+ Now handles Perl immortal scalars explicitly, by storing &sv_yes
+ as such, explicitly.
Retrieval of non-immortal undef cannot be shared. Previous
version was over-optimizing by not creating a separate SV for
Wrote sizeof(SV *) instead of sizeof(I32) when portable, which
in effect mangled the object tags and prevented portability
- accross 32/64 bit architectures!
+ across 32/64 bit architectures!
Wed Mar 25 14:57:02 MET 1998 Raphael Manfredi <Raphael_Manfredi@grenoble.hp.com>
exactly what nstore() is meant for...
However, we continue to use SV addresses as tags for plain store(),
- because benchamarking shows that it saves up to 8% of the store
+ because benchmarking shows that it saves up to 8% of the store
time, and store() is meant to be fast at the expense of lack
of portability.
| Manfredi for providing us with this very useful module.
+=======================================================================
-The Storable extension brings persistency to your data.
+The Storable extension brings persistence to your data.
You may recursively store to disk any data structure, no matter how
complex and circular it is, provided it contains only SCALAR, ARRAY,
make
make install
-There is an embeded POD manual page in Storable.pm.
+There is an embedded POD manual page in Storable.pm.
Storable was written by Raphael Manfredi <Raphael_Manfredi@pobox.com>
-Maitainance is now done by the perl5-porters <perl5-porters@perl.org>
+Maintenance is now done by the perl5-porters <perl5-porters@perl.org>
Please e-mail us with problems, bug fixes, comments and complaints,
although if you have complements you should send them to Raphael.
C<$Storable::accept_future_minor> above). The constant
C<Storable::BIN_WRITE_VERSION_NV> function returns what file version
is written and might be less than C<Storable::BIN_VERSION_NV> in some
-configuations.
+configurations.
=item C<major>, C<minor>
#define SX_OBJECT C(0) /* Already stored object */
#define SX_LSCALAR C(1) /* Scalar (large binary) follows (length, data) */
-#define SX_ARRAY C(2) /* Array forthcominng (size, item list) */
+#define SX_ARRAY C(2) /* Array forthcoming (size, item list) */
#define SX_HASH C(3) /* Hash forthcoming (size, key/value pair list) */
#define SX_REF C(4) /* Reference to object forthcoming */
#define SX_UNDEF C(5) /* Undefined scalar */
* keys are not enough a motivation to reclaim that space).
*
* This structure is also used for memory store/retrieve operations which
- * happen in a fixed place before being malloc'ed elsewhere if persistency
+ * happen in a fixed place before being malloc'ed elsewhere if persistence
* is required. Hence the aptr pointer.
*/
struct extendable {
char *arena; /* Will hold hash key strings, resized as needed */
- STRLEN asiz; /* Size of aforementionned buffer */
+ STRLEN asiz; /* Size of aforementioned buffer */
char *aptr; /* Arena pointer, for in-place read/write ops */
char *aend; /* First invalid address */
};
*
* At retrieve time:
* An array table records the objects which have already been retrieved,
- * as seen by the tag determind by counting the objects themselves. The
+ * as seen by the tag determined by counting the objects themselves. The
* reference to that retrieved object is kept in the table, and is returned
* when an SX_OBJECT is found bearing that same tag.
*
SV *eval; /* whether to eval source code */
int canonical; /* whether to store hashes sorted by key */
#ifndef HAS_RESTRICTED_HASHES
- int derestrict; /* whether to downgrade restrcted hashes */
+ int derestrict; /* whether to downgrade restricted hashes */
#endif
#ifndef HAS_UTF8_ALL
int use_bytes; /* whether to bytes-ify utf8 */
/* 5.6.x introduced the ability to have IVs as long long.
However, Configure still defined BYTEORDER based on the size of a long.
Storable uses the BYTEORDER value as part of the header, but doesn't
- explicity store sizeof(IV) anywhere in the header. Hence on 5.6.x built
+ explicitly store sizeof(IV) anywhere in the header. Hence on 5.6.x built
with IV as long long on a platform that uses Configure (ie most things
except VMS and Windows) headers are identical for the different IV sizes,
despite the files containing some fields based on sizeof(IV)
Erk. Broken-ness.
- 5.8 is consistent - the following redifinition kludge is only needed on
+ 5.8 is consistent - the following redefinition kludge is only needed on
5.6.x, but the interwork is needed on 5.8 while data survives in files
with the 5.6 header.
* values stored are not real SV, just integers cast to (SV *),
* which explains the freeing below.
*
- * It is also one possible bottlneck to achieve good storing speed,
+ * It is also one possible bottleneck to achieve good storing speed,
* so the "shared keys" optimization is turned off (unlikely to be
* of any use here), and the hash table is "pre-extended". Together,
* those optimizations increase the throughput by 12%.
*
* The surrounding if() protection has been added because there might be
* some cases where this routine is called more than once, during
- * exceptionnal events. This was reported by Marc Lehmann when Storable
+ * exceptional events. This was reported by Marc Lehmann when Storable
* is executed from mod_perl, and the fix was suggested by him.
* -- RAM, 20/12/2000
*/
/*
* If retrieving an old binary version, the cxt->retrieve_vtbl variable
* was set to sv_old_retrieve. We'll need a hash table to keep track of
- * the correspondance between the tags and the tag number used by the
+ * the correspondence between the tags and the tag number used by the
* new retrieve routines.
*/
}
/***
- *** Sepcific store routines.
+ *** Specific store routines.
***/
/*
*
* Store an array.
*
- * Layout is SX_ARRAY <size> followed by each item, in increading index order.
+ * Layout is SX_ARRAY <size> followed by each item, in increasing index order.
* Each item is stored as <object>.
*/
static int store_array(pTHX_ stcxt_t *cxt, AV *av)
* Values are stored as <object>.
* Keys are stored as <flags> <length> <data>, the <data> section being omitted
* if length is 0.
- * Currently the only hash flag is "restriced"
+ * Currently the only hash flag is "restricted"
* Key flags are as for hv.h
*/
static int store_hash(pTHX_ stcxt_t *cxt, HV *hv)
* Note that we store the Perl object as-is. We don't call its FETCH
* method along the way. At retrieval time, we won't call its STORE
* method either, but the tieing magic will be re-installed. In itself,
- * that ensures that the tieing semantics are preserved since futher
+ * that ensures that the tieing semantics are preserved since further
* accesses on the retrieved object will indeed call the magic methods...
*/
* Ensure sv is actually a reference. From perl, we called something
* like:
* pstore(aTHX_ FILE, \@array);
- * so we must get the scalar value behing that reference.
+ * so we must get the scalar value behind that reference.
*/
if (!SvROK(sv))
*
* We read object tags and we can convert them into SV* on the fly
* because we know all the references listed in there (as tags)
- * have been already serialized, hence we have a valid correspondance
+ * have been already serialized, hence we have a valid correspondence
* between each of those tags and the recreated SV.
*/
* retrieve_array
*
* Retrieve a whole array.
- * Layout is SX_ARRAY <size> followed by each item, in increading index order.
+ * Layout is SX_ARRAY <size> followed by each item, in increasing index order.
* Each item is stored as <object>.
*
* When we come here, SX_ARRAY has been read already.
*
* Retrieve a whole array in pre-0.6 binary format.
*
- * Layout is SX_ARRAY <size> followed by each item, in increading index order.
+ * Layout is SX_ARRAY <size> followed by each item, in increasing index order.
* Each item is stored as SX_ITEM <object> or SX_IT_UNDEF for "holes".
*
* When we come here, SX_ARRAY has been read already.
if ((cxt->netorder = (use_network_order & 0x1))) /* Extra () for -Wall */
return &PL_sv_undef; /* No byte ordering info */
- /* In C truth is 1, falsehood is 0. Very convienient. */
+ /* In C truth is 1, falsehood is 0. Very convenient. */
use_NV_size = version_major >= 2 && version_minor >= 2;
if (version_major >= 0) {
/*
* Grab address tag which identifies the object if we are retrieving
* an older format. Since the new binary format counts objects and no
- * longer explicitely tags them, we must keep track of the correspondance
+ * longer explicitly tags them, we must keep track of the correspondence
* ourselves.
*
* The following section will disappear one day when the old format is
* so that we can croak when behaviour cannot be re-installed, and also
* avoid testing for overloading magic at each reference retrieval.
*
- * Unfortunately, the root reference is implicitely stored, so we must
+ * Unfortunately, the root reference is implicitly stored, so we must
* check for possible overloading now. Furthermore, if we don't restore
* overloading, we cannot croak as if the original ref was, because we
* have no way to determine whether it was an overloaded ref or not in
# We can also test this empirically
$struct->[1]->{value} = 'Goodbye cruel world!';
-is_deeply( $struct, $thawed, 'Empiric testing corfirms correct behaviour' );
+is_deeply( $struct, $thawed, 'Empiric testing confirms correct behaviour' );
# End Tests
###########
use Test::More tests => 8;
-# Uncomment the folowing line to get a dump of the constructed data structure
+# Uncomment the following line to get a dump of the constructed data structure
# (you may want to reduce the size of the hashes too)
# $debugging = 1;
is($x1, $x3);
# In normal mode it is exceedingly unlikely that the frozen
-# representaions of all the hashes will be the same (normally the hash
+# representations of all the hashes will be the same (normally the hash
# elements are frozen in the order they are stored internally,
# i.e. pseudo-randomly).
my $string = Storable::freeze( $array );
my $thawed = Storable::thaw( $string );
-# is_deeply infinite loops in ciculars, so do it manually
+# is_deeply infinite loops in circulars, so do it manually
# is_deeply( $array, $thawed, 'Circular hooked objects work' );
is( ref($thawed), 'ARRAY', 'Top level ARRAY' );
is( scalar(@$thawed), 1, 'ARRAY contains one element' );
# TODO tests.
warn "# Test skipped because eq is buggy for certain Unicode cases in 5.6.0";
warn "# Please upgrade to 5.6.1\n";
- ok ("I'd really like to fail this test on 5.6.0 but I'm told that CPAN auto-dependancies mess up, and certain vendors only ship 5.6.0. Get your vendor to ugrade. Else upgrade your vendor.");
+ ok ("I'd really like to fail this test on 5.6.0 but I'm told that CPAN auto-dependencies mess up, and certain vendors only ship 5.6.0. Get your vendor to ugrade. Else upgrade your vendor.");
# One such vendor being the folks who brought you LONG_MIN as a positive
# integer.
} else {
#---
-# blessed reference to overloded object.
+# blessed reference to overloaded object.
{
my $a = bless [88], 'OVERLOADED';
my $c = thaw freeze bless \$a, 'main';
print "1..0 # Skip: No Hash::Util pre 5.005\n";
exit 0;
# And doing this seems on 5.004 seems to create bogus warnings about
- # unitialized variables, or coredumps in Perl_pp_padsv
+ # uninitialized variables, or coredumps in Perl_pp_padsv
} elsif (!eval "require Hash::Util") {
if ($@ =~ /Can\'t locate Hash\/Util\.pm in \@INC/s) {
print "1..0 # Skip: No Hash::Util:\n";
# This is the root recursive dumping routine that may indirectly be
# called by one of the routine it calls...
# The link parameter is set to false when the reference passed to
-# the routine is an internal temporay variable, implying the object's
+# the routine is an internal temporary variable, implying the object's
# address is not to be dumped in the %dumped table since it's not a
# user-visible object.
sub recursive_dump {
### If I say
### $hash{'attribute'} = $d;
-### below, then dump() incorectly dumps the hash value as a string the second
+### below, then dump() incorrectly dumps the hash value as a string the second
### time it is reached. I have not investigated enough to tell whether it's
### a bug in my dump() routine or in the Perl tieing mechanism.
$scalar = 'foo';
chop $x;
is($x, ${thaw freeze \$x});
-# Storable needs to cope if a frozen string happens to be internall utf8
+# Storable needs to cope if a frozen string happens to be internal utf8
# encoded
$x = chr 256;
$data .= chr 256;
-# This definately isn't valid
+# This definitely isn't valid
eval {thaw $data};
like($@, qr/corrupt.*characters outside/);
2.03 Sun Sep 14 20:01:48 PDT 2003
* phashes produced via fields::new() will now not warn when used for
- forward compatiblity purposes
+ forward compatibility purposes
- Reformatting the docs to make them a bit more readable
- Making it clear that fields::new() is usable with or without
pseudohashes
- * Fixing inheritence from classes which have only private fields
- * Fixing inheritence when an intermediate class has no fields.
+ * Fixing inheritance from classes which have only private fields
+ * Fixing inheritance when an intermediate class has no fields.
[perlbug 20020326.004]
- Removing uses of 'our' from tests for backwards compat.
- Forgot to set the INSTALLDIRS to 'perl'
2.0 Wed Aug 27 21:47:51 PDT 2003
- * Seperated from Class::Fields
+ * Separated from Class::Fields
my X $self = shift;
$self = fields::new($self) unless ref $self;
$self->{X1} = "x1";
- # FIXME. This code is dead on blead becase the test is skipped.
+ # FIXME. This code is dead on blead because the test is skipped.
# The test states that it's being skipped because restricted hashes
# don't support a feature. Presumably we need to make that feature
# supported. Bah.
# this causes a different low lib to take care...
$lib_kind = $1; $lib_kind = 'lib' if $lib_kind eq 'l';
$lib = $_[$i+1] || '';
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(a|accuracy)$/)
{
$a = $_[$i+1];
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(p|precision)$/)
{
$p = $_[$i+1];
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(v|version)$/)
perl -Mbigint=a,2 -le 'print 12345+1'
-Note that setting precision and accurary at the same time is not possible.
+Note that setting precision and accuracy at the same time is not possible.
=item p or precision
perl -Mbignum=p,5 -le 'print 123456789+123'
-Note that setting precision and accurary at the same time is not possible.
+Note that setting precision and accuracy at the same time is not possible.
=item t or trace
Using C<lib> warns if none of the specified libraries can be found and
L<Math::BigInt> did fall back to one of the default libraries.
-To supress this warning, use C<try> instead:
+To suppress this warning, use C<try> instead:
use bignum try => 'GMP';
{
# this causes upgrading
$upgrade = $_[$i+1]; # or undef to disable
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] eq 'downgrade')
{
# this causes downgrading
$downgrade = $_[$i+1]; # or undef to disable
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(l|lib|try|only)$/)
# this causes a different low lib to take care...
$lib_kind = $1; $lib_kind = 'lib' if $lib_kind eq 'l';
$lib = $_[$i+1] || '';
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(a|accuracy)$/)
{
$a = $_[$i+1];
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(p|precision)$/)
{
$p = $_[$i+1];
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(v|version)$/)
perl -Mbignum=a,50 -le 'print sqrt(20)'
-Note that setting precision and accurary at the same time is not possible.
+Note that setting precision and accuracy at the same time is not possible.
=item p or precision
perl -Mbignum=p,-50 -le 'print sqrt(20)'
-Note that setting precision and accurary at the same time is not possible.
+Note that setting precision and accuracy at the same time is not possible.
=item t or trace
Using C<lib> warns if none of the specified libraries can be found and
L<Math::BigInt> did fall back to one of the default libraries.
-To supress this warning, use C<try> instead:
+To suppress this warning, use C<try> instead:
use bignum try => 'GMP';
=head2 SIGN
-The sign is either '+', '-', 'NaN', '+inf' or '-inf' and stored seperately.
+The sign is either '+', '-', 'NaN', '+inf' or '-inf' and stored separately.
You can access it with the sign() method.
A sign of 'NaN' is used to represent the result when input arguments are not
{
# this causes upgrading
$upgrade = $_[$i+1]; # or undef to disable
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s;
}
elsif ($_[$i] =~ /^(l|lib|try|only)$/)
# this causes a different low lib to take care...
$lib_kind = $1; $lib_kind = 'lib' if $lib_kind eq 'l';
$lib = $_[$i+1] || '';
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(a|accuracy)$/)
{
$a = $_[$i+1];
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(p|precision)$/)
{
$p = $_[$i+1];
- my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existant..."
+ my $s = 2; $s = 1 if @a-$j < 2; # avoid "can not modify non-existent..."
splice @a, $j, $s; $j -= $s; $i++;
}
elsif ($_[$i] =~ /^(v|version)$/)
print 1/3,"\n"; # 0.33333...
}
- # Note that this will make hex() and oct() be globally overriden:
+ # Note that this will make hex() and oct() be globally overridden:
use bigrat qw/hex oct/;
print hex("0x1234567890123490"),"\n";
print oct("01234567890123490"),"\n";
Using C<lib> warns if none of the specified libraries can be found and
L<Math::BigInt> did fall back to one of the default libraries.
-To supress this warning, use C<try> instead:
+To suppress this warning, use C<try> instead:
use bignum try => 'GMP';
Since all numbers are not objects, you can use all functions that are part of
the BigInt or BigFloat API. It is wise to use only the bxxx() notation, and not
-the fxxx() notation, though. This makes you independed on the fact that the
+the fxxx() notation, though. This makes you independent on the fact that the
underlying object might morph into a different class than BigFloat.
=over 2
Math with the numbers is done (by default) by a module called
-=head2 Cavaet
+=head2 Caveat
But a warning is in order. When using the following to make a copy of a number,
only a shallow copy will be made.
perl -Mbigrat=a,50 -le 'print sqrt(20)'
-Note that setting precision and accurary at the same time is not possible.
+Note that setting precision and accuracy at the same time is not possible.
=item p or precision
perl -Mbigrat=p,-50 -le 'print sqrt(20)'
-Note that setting precision and accurary at the same time is not possible.
+Note that setting precision and accuracy at the same time is not possible.
=item t or trace
=item oct
Override the built-in oct() method with a version that can handle big
-integers. Note that under Perl v5.9.4 or ealier, this will be global
+integers. Note that under Perl v5.9.4 or earlier, this will be global
and cannot be disabled with "no bigint;".
=item v or version
###############################################################################
-# accurarcy and precision
+# accuracy and precision
is (bigint->accuracy(), undef);
is (bigint->accuracy(12),12);
is (1/3, '0.3333333333333333333333333333333333333333');
###############################################################################
-# accurarcy and precision
+# accuracy and precision
is (bignum->accuracy(), undef);
is (bignum->accuracy(12),12);
is (3/7 / 1.5,'2/7');
###############################################################################
-# accurarcy and precision
+# accuracy and precision
is (bigrat->accuracy(), undef);
is (bigrat->accuracy(12),12);
#define UL_MAGIC_SIG 0x554C /* UL = user lock */
/*
- * The shared things need an intepreter to live in ...
+ * The shared things need an interpreter to live in ...
*/
PerlInterpreter *PL_sharedsv_space; /* The shared sv space */
/* To access shared space we fake aTHX in this scope and thread's context */
/* Can a shared object be destroyed?
* True if not a shared,
- * or if detroying last proxy on a shared object
+ * or if destroying last proxy on a shared object
*/
#ifdef PL_destroyhook
bool
}
#endif
-/* veto signal despatch if we have the lock */
+/* veto signal dispatch if we have the lock */
#ifdef PL_signalhook
$$foo = "yeah2";
ok(6, $$foo eq "yeah2", "Check that deref assignment works");
threads->create(sub {$bar = "yeah3"})->join();
-ok(7, $$foo eq "yeah3", "Check that other thread assignemtn works");
+ok(7, $$foo eq "yeah3", "Check that other thread assignment works");
threads->create(sub {$foo = "artur"})->join();
ok(8, $foo eq "artur", "Check that uncopupling the ref works");
my $baz;
### Start of Testing ###
ok(1, 'Loaded');
-# Tests freeing the Perl interperter for each thread
+# Tests freeing the Perl interpreter for each thread
# See http://www.nntp.perl.org/group/perl.perl5.porters/110772 for details
my ($COUNT, $STARTED) :shared;
### Start of Testing ###
ok(1, 'Loaded');
-# Tests freeing the Perl interperter for each thread
+# Tests freeing the Perl interpreter for each thread
# See http://www.nntp.perl.org/group/perl.perl5.porters/110772 for details
my $COUNT;
}
-# Returing a closure from a thread caused problems. If the last index in
+# Returning a closure from a thread caused problems. If the last index in
# the anon sub's pad wasn't for a lexical, then a core dump could occur.
# Otherwise, there might be leaked scalars.