Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[v6.d REVIEW] Document how we came up with 1+0i for power
  • Loading branch information
zoffixznet committed Jul 28, 2018
1 parent 344d60d commit ba9f523
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions S32-num/complex.t
Expand Up @@ -258,6 +258,11 @@ subtest 'exponentiation with zero (n = 0+0i)' => {
plan 3;

# Per discussion on https://rt.perl.org/Public/Bug/Display.html?id=128785
# + majority of languages doing the 1+0i and not a NaN
# http://rosettacode.org/wiki/Zero_to_the_zero_power
# + IEEE Std 1076.2-1996 IEEE Standard VHDL Mathematical Packages
# https://perso.telecom-paristech.fr/guilley/ENS/20171205/TP/tp_syn/doc/IEEE_VHDL_1076.2-1996.pdf
# that defines EXP operation for complex and does use 1+0i for the zero case
constant n = 0+0i;
is-deeply n**0, 1+0i, 'n**0';
is-deeply n**n, 1+0i, 'n**n';
Expand Down

0 comments on commit ba9f523

Please sign in to comment.