Skip to content

Commit f2e2351

Browse files
committed
add perldelta for sv_numeq fix and other sv_num* additions
modified the sv.c documentation since the perldelta sv_numeq link had multiple targets.
1 parent 8cb260b commit f2e2351

File tree

2 files changed

+37
-19
lines changed

2 files changed

+37
-19
lines changed

pod/perldelta.pod

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,37 @@ well.
358358

359359
=item *
360360

361-
XXX
361+
Fixed a bug in the L<perlapi/sv_numeq> API where values with numeric
362+
("0+") overloading but not equality or numeric comparison overloading
363+
would always be compared as floating point values. This could lead to
364+
large integers being reported as equal when they weren't.
365+
366+
=item *
367+
368+
Fixed a bug in L<perlapi/sv_numeq> where the C<SV_SKIP_OVERLOAD> flag
369+
would skip operator overloading, but would still honor numeric ("0+")
370+
overloading.
371+
372+
=item *
373+
374+
Added L<perlapi/sv_numne>, sv_numle, sv_numlt, sv_numge, sv_numgt and
375+
L<perlapi/sv_numcmp> APIs that perform numeric comparison in the same
376+
way perl does, including overloading. Separate APIs for each
377+
comparison are needed to invoke their corresponding overload when
378+
needed. Inspired by [GH #23918]
379+
380+
This also extends the sv_numeq API to support C<SV_FORCE_OVERLOAD>.
381+
382+
=item *
383+
384+
Added the C<AMGf_force_scalar> flag to the L<perlapi/C<amagic_call>>
385+
API to force scalar context for overload calls.
386+
387+
=item *
388+
389+
Added the C<AMGf_force_overload> flag to the L<perlapi/C<amagic_call>>
390+
API to allow forcing overloading to be honored even in the context of
391+
C<no overloading;>.
362392

363393
=back
364394

sv.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8833,39 +8833,27 @@ These return a boolean that is the result of the corresponding numeric
88338833

88348834
=over
88358835

8836-
=item C<sv_numeq>
8837-
8838-
=item C<sv_numeq_flags>
8836+
=item C<sv_numeq>, C<sv_numeq_flags>
88398837

88408838
Numeric equality, the same as S<C<$sv1 == $sv2>>.
88418839

8842-
=item C<sv_numne>
8843-
8844-
=item C<sv_numne_flags>
8840+
=item C<sv_numne>, C<sv_numne_flags>
88458841

88468842
Numeric inequality, the same as S<C<$sv1 != $sv2>>.
88478843

8848-
=item C<sv_numle>
8849-
8850-
=item C<sv_numle_flags>
8844+
=item C<sv_numle>, C<sv_numle_flags>
88518845

88528846
Numeric less than or equal, the same as S<C<$sv1 E<lt>= $sv2>>.
88538847

8854-
=item C<sv_numlt>
8855-
8856-
=item C<sv_numlt_flags>
8848+
=item C<sv_numlt>, C<sv_numlt_flags>
88578849

88588850
Numeric less than, the same as S<C<$sv1 E<lt> $sv2>>.
88598851

8860-
=item C<sv_numge>
8861-
8862-
=item C<sv_numge_flags>
8852+
=item C<sv_numge>, C<sv_numge_flags>
88638853

88648854
Numeric greater than or equal, the same as S<C<$sv1 E<gt>= $sv2>>.
88658855

8866-
=item C<sv_numgt>
8867-
8868-
=item C<sv_numgt_flags>
8856+
=item C<sv_numgt>, C<sv_numgt_flags>
88698857

88708858
Numeric greater than, the same as S<C<$sv1 E<gt> $sv2>>.
88718859

0 commit comments

Comments
 (0)