Skip to content

Commit 096a2ec

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 6b31a64 commit 096a2ec

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

pod/perldelta.pod

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,23 @@ whether the string buffer contents are "live" or not.)
359359

360360
See GH#23967 for an example of where such a copy was noticeable.
361361

362+
Fixed a bug in the L<perlapi/sv_numeq> API where values with numeric
363+
("0+") overloading but not equality or numeric comparison overloading
364+
would always be compared as floating point values. This could lead to
365+
large integers being reported as equal when they weren't.
366+
362367
=item *
363368

364-
XXX
369+
Added L<perlapi/sv_numne>, sv_numle, sv_numlt, sv_numge, sv_numgt and
370+
L<perlapi/sv_numcmp> APIs that perform numeric comparison in the same
371+
way perl does, including overloading. Separate APIs for each
372+
comparison are needed to invoke their corresponding overload when
373+
needed. Inspired by [GH #23918]
374+
375+
=item *
376+
377+
Added the C<AMGf_force_scalar> flag to the L<perlapi/C<amagic_call>>
378+
API to force scalar context for overload calls.
365379

366380
=back
367381

sv.c

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

87638763
=over
87648764

8765-
=item C<sv_numeq>
8766-
8767-
=item C<sv_numeq_flags>
8765+
=item C<sv_numeq>, C<sv_numeq_flags>
87688766

87698767
Numeric equality, the same as S<C<$sv1 == $sv2>>.
87708768

8771-
=item C<sv_numne>
8772-
8773-
=item C<sv_numne_flags>
8769+
=item C<sv_numne>, C<sv_numne_flags>
87748770

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

8777-
=item C<sv_numle>
8778-
8779-
=item C<sv_numle_flags>
8773+
=item C<sv_numle>, C<sv_numle_flags>
87808774

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

8783-
=item C<sv_numlt>
8784-
8785-
=item C<sv_numlt_flags>
8777+
=item C<sv_numlt>, C<sv_numlt_flags>
87868778

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

8789-
=item C<sv_numge>
8790-
8791-
=item C<sv_numge_flags>
8781+
=item C<sv_numge>, C<sv_numge_flags>
87928782

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

8795-
=item C<sv_numgt>
8796-
8797-
=item C<sv_numgt_flags>
8785+
=item C<sv_numgt>, C<sv_numgt_flags>
87988786

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

0 commit comments

Comments
 (0)