In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/f33fddeca8c03e72b526d822c4d7f75e6399ddf8?hp=a3d47e0d2ac20034d8d96f777e886b55ab96dd0f>
- Log ----------------------------------------------------------------- commit f33fddeca8c03e72b526d822c4d7f75e6399ddf8 Author: Jarkko Hietaniemi <[email protected]> Date: Tue Sep 2 07:42:24 2014 -0400 Basic string-to-nv should equal floating point literals. (In my floating point adventures I managed to break this basic assumption, guard against it happening again.) ----------------------------------------------------------------------- Summary of changes: t/opbasic/arith.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/opbasic/arith.t b/t/opbasic/arith.t index a90e84c..10efe86 100644 --- a/t/opbasic/arith.t +++ b/t/opbasic/arith.t @@ -9,7 +9,7 @@ BEGIN { # functions imported from t/test.pl or Test::More, as those programs/libraries # use operators which are what is being tested in this file. -print "1..175\n"; +print "1..181\n"; sub try ($$$) { print +($_[1] ? "ok" : "not ok"), " $_[0] - $_[2]\n"; @@ -468,3 +468,11 @@ try $T++, 0.1530000e-305 != 0.0, '0.1530000e-305'; try $T++, 0.1530001e-305 != 0.0, '0.1530001e-305'; try $T++, 1.17549435100e-38 != 0.0, 'min single'; try $T++, 2.2250738585072014e-308 != 0.0, 'min double'; + +# string-to-nv should equal float literals +try $T++, "1.23" + 0 == 1.23, '1.23'; +try $T++, " 1.23" + 0 == 1.23, '1.23 with leading space'; +try $T++, "1.23 " + 0 == 1.23, '1.23 with trailing space'; +try $T++, "+1.23" + 0 == 1.23, '1.23 with unary plus'; +try $T++, "-1.23" + 0 == -1.23, '1.23 with unary minus'; +try $T++, "1.23e4" + 0 == 12300, '1.23e4'; -- Perl5 Master Repository
