Skip to content

Commit e4ff664

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 53a54ff commit e4ff664

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
@@ -361,7 +361,37 @@ See GH#23967 for an example of where such a copy was noticeable.
361361

362362
=item *
363363

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

366396
=back
367397

sv.c

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

87928792
=over
87938793

8794-
=item C<sv_numeq>
8795-
8796-
=item C<sv_numeq_flags>
8794+
=item C<sv_numeq>, C<sv_numeq_flags>
87978795

87988796
Numeric equality, the same as S<C<$sv1 == $sv2>>.
87998797

8800-
=item C<sv_numne>
8801-
8802-
=item C<sv_numne_flags>
8798+
=item C<sv_numne>, C<sv_numne_flags>
88038799

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

8806-
=item C<sv_numle>
8807-
8808-
=item C<sv_numle_flags>
8802+
=item C<sv_numle>, C<sv_numle_flags>
88098803

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

8812-
=item C<sv_numlt>
8813-
8814-
=item C<sv_numlt_flags>
8806+
=item C<sv_numlt>, C<sv_numlt_flags>
88158807

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

8818-
=item C<sv_numge>
8819-
8820-
=item C<sv_numge_flags>
8810+
=item C<sv_numge>, C<sv_numge_flags>
88218811

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

8824-
=item C<sv_numgt>
8825-
8826-
=item C<sv_numgt_flags>
8814+
=item C<sv_numgt>, C<sv_numgt_flags>
88278815

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

0 commit comments

Comments
 (0)