New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensible Complex turns to NaN #1236
Comments
From @colomoncolomon: rakudo: say exp(3.0 * log(1i)); (First result is correct, second is crazy.) -- |
From @moritzOn Fri Aug 28 14:23:50 2009, colomon@gmail.com wrote:
22:04 <@moritz_> rakudo: sub iPower($a, $b) { exp($b * log($a)) }; say Which is much better - just needs tests. Cheers, |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S32-num/complex.t commit c0e06f4657f82d1d2f99f47ef7bab76c660aff4e [t/spec] tests for RT #68848, complex powers wrapped in a subroutine Inline Patchdiff --git a/t/spec/S32-num/complex.t b/t/spec/S32-num/complex.t
index e86ee90..168a66b 100644
--- a/t/spec/S32-num/complex.t
+++ b/t/spec/S32-num/complex.t
@@ -150,6 +150,16 @@ my $pi = 3.141592653589793238;
is_approx(4.unpolar($pi), -4, "4.unpolar(pi) == -4");
}
+
+# used to be RT #68848
+{
+ is_approx exp(3.0 * log(1i)), -1.83697e-16-1i,
+ 'exp(3.0 * log(1i))';
+ sub iPower($a, $b) { exp($b * log($a)) };
+ is_approx iPower(1i, 3.0), -1.83697e-16-1i, 'same as wrapped as sub';
+
+}
+
done_testing;
# vim: ft=perl6 |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#68848 (status was 'resolved')
Searchable as RT68848$
The text was updated successfully, but these errors were encountered: