Jerry D. Hedden [Fri, 19 Oct 2007 20:50:27 +0000 (16:50 -0400)]
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <
1ff86f510710191750s3f25eae2x2dc2e90f18f1f716@mail.gmail.com>
p4raw-id: //depot/perl@32148
X<sv_2num>
Return an SV with the numeric value of the source SV, doing any necessary
-reference or overload conversion.
+reference or overload conversion. You must use the C<SvNUM(sv)> macro to
+access this function.
SV* sv_2num(SV* sv)
=for apidoc sv_2num
Return an SV with the numeric value of the source SV, doing any necessary
-reference or overload conversion.
+reference or overload conversion. You must use the C<SvNUM(sv)> macro to
+access this function.
=cut
*/
SV *
Perl_sv_2num(pTHX_ register SV *sv)
{
- if (!SvROK(sv))
- return sv;
-
if (SvAMAGIC(sv)) {
SV * const tmpsv = AMG_CALLun(sv,numer);
if (tmpsv && (!SvROK(tmpsv) || (SvRV(tmpsv) != SvRV(sv))))