OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Calc rise to power

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
midan
Newbie
Newbie


Joined: 11 Feb 2009
Posts: 2

PostPosted: Wed Feb 11, 2009 2:59 am    Post subject: Calc rise to power Reply with quote

I need to resolve this formula S=(J3+SQRT(I3^3+J3^2))^(1/3) where
i3=-0.1111111 and j3=-0.9629630 i get an "#VALUE!" result
for other values like i3=0.5 and j3=0.4 is ok


---
Sorry for my bad english
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Wed Feb 11, 2009 5:32 am    Post subject: Reply with quote

You try to get the root of a negative number.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
midan
Newbie
Newbie


Joined: 11 Feb 2009
Posts: 2

PostPosted: Wed Feb 11, 2009 6:30 am    Post subject: Reply with quote

Calculated with OOCalc I3^3+J3^2=0.9259259 , is greather then 0

(J3+SQRT(I3^3+J3^2))=-0.0007125
the problem is in this step -0.0007125^(1/3)
Back to top
View user's profile Send private message
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2910
Location: Egersund, Norway

PostPosted: Wed Feb 11, 2009 1:32 pm    Post subject: Reply with quote

To find the cubic root of a negative base, you can use IMABS(IMPOWER(base;1/3))*SIGN(base). It's useful to find the base first (a cell with an intermediate calculation). Explanation follows...

With integer powers, Calc will use the "natural" procedure, and all is well. If the exponent is not an integer, Calc will use a different way to calculate the power. This involves using logarithms, which do not work well with negative arguments.

Some math knowledge is necessary:
When the base is negative and the exponent is a fraction, the power will be a number somewhere in the complex plane. Generally we do not know that the power has an answer in the real numbers (i.e. no imaginary part). However, with the exponent of 1/3 we know that for every real base there is a real answer.

Still, in this situation we need to use the tools for working with complex numbers, the IM...() functions.
Say we have the number to find the cube root of in cell A1. =IMPOWER(A1;1/3) will give a correct answer in the complex plane, but never the real number we want.
However, we know that all answers will have the same absolute value, so we'll extract that: =IMABS(IMPOWER(A1;1/3)).
The absolute value is always a positive number, but the root will have the same sign as the base, so to keep the sign: =IMABS(IMPOWER(A1;1/3))*SIGN(A1)
Back to top
View user's profile Send private message
Ed
Super User
Super User


Joined: 28 May 2003
Posts: 1041

PostPosted: Wed Feb 11, 2009 2:07 pm    Post subject: Reply with quote

keme wrote:
To find the cubic root of a negative base, you can use IMABS(IMPOWER(base;1/3))*SIGN(base). It's useful to find the base first (a cell with an intermediate calculation).


For a cube root, you could use SIGN(base)*ABS(base)^(1/3). Of course if you know that base is a negative number then you could just use -(-base)^(1/3)

Avoiding the use of complex number functions should make the calculation more accurate.
Back to top
View user's profile Send private message
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2910
Location: Egersund, Norway

PostPosted: Wed Feb 11, 2009 2:09 pm    Post subject: Reply with quote

Of course, but where's the fun in that... Rolling Eyes


Embarassed <hiding face in hands and will not be able to face other people for a week at least>
Back to top
View user's profile Send private message
bblackmoor
Newbie
Newbie


Joined: 11 Jan 2007
Posts: 4

PostPosted: Wed Jul 29, 2009 2:16 pm    Post subject: Re: Calc rise to power Reply with quote

midan wrote:
I need to resolve this formula S=(J3+SQRT(I3^3+J3^2))^(1/3) where
i3=-0.1111111 and j3=-0.9629630 i get an "#VALUE!" result
for other values like i3=0.5 and j3=0.4 is ok


The problem is that OpenOffice Calc returns an error when it attempts to find the root of a negative number, because it uses flawed logic to determine the value of roots (i.e., not taking into account the sign of the base) -- a bug it has had for at least four years, and probably since its creation.

Yes, you can do it manually: you should not need to.

Microsoft Excel does not have this bug. Every time I have a conversation with someone and I tell them they have no need to ever use Microsoft Office again, this years-old trival-to-fix bug sits on my shoulder and laughs at me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group