From c02bf4bc79ce6aba703bec7cb7d99e64fb2b7ca3 Mon Sep 17 00:00:00 2001 From: thundergnat Date: Sat, 5 Dec 2015 18:29:25 -0500 Subject: [PATCH] Add tests for RT 126825 --- S32-num/rounders.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/S32-num/rounders.t b/S32-num/rounders.t index f7d1ca5f03..77e0ed2321 100644 --- a/S32-num/rounders.t +++ b/S32-num/rounders.t @@ -127,8 +127,13 @@ for %tests.keys.sort -> $t { is $num.round(1e-5), 123.45679, "($num).round(1e-5) == 123.45679"; } - - +{ # RT 126825 + my $complex = 5.123456789+3.987654321i; + is $complex.round(1), 5+4i, "complex round with argument"; + is $complex.round(5), 5+5i, "($complex).round(5) == 5+5i"; + is $complex.round(1/100), 5.12+3.99i, "($complex).round(1/100) == 5.12+3.99i"; + is $complex.round(1e-3), 5.123+3.988i, "($complex).round(1e-3) == 5.123+3.988i"; +} { my $big-int = 1234567890123456789012345678903;