in reply to Re^5: How does Math::GMP overload the assignment operator ? (more guessing)
in thread How does Math::GMP overload the assignment operator ?
Can do the same with Math::GMPz ... not exactly sure how it works there (as there's no explicit '0+' overloading) :C:\>perl -MMath::GMP -wle "@x = qw(a b c d e f g h i j k l m n); print + $x[Math::GMP->new(-2)];" m
UPDATE 2: This capability of '0+' overloading definitely provides a useful feature.C:\>perl -MMath::GMPz -wle "@x = ('a' .. 'n'); for(Math::GMPz->new(0) +.. Math::GMPz->new(@x - 1)) { print $x[$_] }" a b c d e f g h i j k l m n
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: How does Math::GMP overload the assignment operator ? (more guessing)
by Haarg (Priest) on Nov 10, 2020 at 19:54 UTC | |
by syphilis (Archbishop) on Nov 11, 2020 at 00:55 UTC | |
Re^7: How does Math::GMP overload the assignment operator ? (more guessing)
by jcb (Parson) on Nov 11, 2020 at 00:52 UTC | |
by syphilis (Archbishop) on Nov 11, 2020 at 01:30 UTC |