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
&infix:<**>( Complex, UInt ) is inaccurate #5876
Comments
From @b2gillssay i ** 3; # -1.83697019872103e-16-1i say i * i * i; # -0-1i my Complex $acc; Currently it is handled by multi sub infix:<**>(Complex:D \a, Num(Real) \b) returns Complex:D { Which I think would be necessary for negative Ints ( I don't know enough about Complex numbers ) I came across this when creating a golf entry for https://codegolf.stackexchange.com/questions/102059/complex-binary-numbers/102523#102523 *.base(2).comb(/1+/).map(i***.chars).sum I had to go with the following instead *.base(2).comb(/1+/).map({[*] i xx.chars}).sum |
From @zoffixznetOn Thu, 08 Dec 2016 07:45:18 -0800, brad wrote:
As discussed on IRC https://irclog.perlgeek.de/perl6/2016-12-08#i_13705128 the current result is accurate, it's just not perfectly precise to give the -0-i answer. Perl 5's Math::Complex also gives the same noisy answer. I've tried a couple of different algos that result in -0-i, but the fastest of them made the calculation 60x slower (others going as slow as 508x slower). So I'm closing this as a won't-fix. |
The RT System itself - Status changed from 'new' to 'open' |
@zoffixznet - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#130299 (status was 'rejected')
Searchable as RT130299$
The text was updated successfully, but these errors were encountered: