in reply to Re^4: How does Math::GMP overload the assignment operator ? (more guessing)
in thread How does Math::GMP overload the assignment operator ?
If there were arithmetic operators that were not overloaded, Perl would invoke numeric conversion before using the builtin arithmetic operations, but I expect Math::GMP to overload all of them, so int may be the only built-in that actually invokes the numeric conversion.
I expect (but am not certain) that the '0+' overload is also invoked if an XSUB attempts to convert an object to an IV or UV. This is probably (but I have not traced the code) also how builtin arithmetic operations (which are not used on Math::GMP objects) would end up invoking it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: How does Math::GMP overload the assignment operator ? (more guessing)
by syphilis (Archbishop) on Nov 10, 2020 at 11:52 UTC | |
by Haarg (Priest) on Nov 10, 2020 at 19:54 UTC | |
by syphilis (Archbishop) on Nov 11, 2020 at 00:55 UTC | |
by jcb (Parson) on Nov 11, 2020 at 00:52 UTC | |
by syphilis (Archbishop) on Nov 11, 2020 at 01:30 UTC |