This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #130335) fix numeric comparison for sort's built-in compare
authorTony Cook <tony@develop-help.com>
Wed, 14 Dec 2016 03:24:08 +0000 (14:24 +1100)
committerJames E Keenan <jkeenan@cpan.org>
Fri, 23 Dec 2016 13:13:34 +0000 (08:13 -0500)
commit427fbfe878efea40f50caa8b0da22803460f50b0
tree73768dcc97c1c4cea186dda2e0966d344c8133e6
parentc9e7382961164fbbd62ade71269b59a2cfcc26aa
(perl #130335) fix numeric comparison for sort's built-in compare

For non-'use integer' this would always compare as NVs, but with
64-bit integers and non-long doubles, integers can have more
significant digits, making the sort <=> replacement less precise
than the <=> operator.

Use the same code to perform the comparison that <=> does, which
happens to be handily broken out into Perl_do_ncmp().
pp_sort.c
t/lib/warnings/9uninit
t/op/sort.t