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

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

[Octave-bug-tracker] [bug #56062] Strange result solving a simple proble


From: Vytenis
Subject: [Octave-bug-tracker] [bug #56062] Strange result solving a simple problem
Date: Tue, 2 Apr 2019 17:37:21 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

Follow-up Comment #3, bug #56062 (project octave):

Yeah, I forgot that there are many roots and the one returned is not the one I
expect.

I thought these should be equal, but I will have to dig deeper.

>> (-8)^(1/3)
ans = 1.0000 + 1.7321i
>> cbrt(-8)
ans = -2

It seems the one returned in the first expression is because it has the
smallest argument, and in the second expression because it is real
(https://en.wikipedia.org/wiki/Nth_root).


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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