octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #66652] Element power operator introduces nume


From: anonymous
Subject: [Octave-bug-tracker] [bug #66652] Element power operator introduces numerical error when broadcasting
Date: Fri, 10 Jan 2025 15:44:38 -0500 (EST)

Follow-up Comment #3, bug #66652 (group octave):


>> x = [i; 2i; 3i] .^ [2 1 0]
x =
  -1.0000 + 0.0000i   0.0000 + 1.0000i   1.0000 +      0i
  -4.0000 + 0.0000i   0.0000 + 2.0000i   1.0000 +      0i
  -9.0000 + 0.0000i   0.0000 + 3.0000i   1.0000 +      0i

>> y = bsxfun ('power', [i; 2i; 3i], [2 1 0])
y =
  -1 + 0i   0 + 1i   1 + 0i
  -4 + 0i   0 + 2i   1 + 0i
  -9 + 0i   0 + 3i   1 + 0i

>> x - y
ans =
            0 + 1.2246e-16i   6.1232e-17 +          0i            0 +
0i
            0 + 4.8986e-16i   1.2246e-16 +          0i            0 +
0i
  -1.7764e-15 + 1.1022e-15i   1.8370e-16 + 4.4409e-16i            0 +
0i


Paavo


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66652>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]