Just because the equation is solvable doesn't mean it doesn't deal in the
realm of imaginary numbers. Since only a subset of roots of negative real
numbers would result in non-imaginary numbers, I think it is clear that the
authors of VBA have chosen to error on such a construct. While this may be
inconsistent with Excel, there is no reason to expect them to be the same in
this gray area - VBA is a separate product that has been coupled with Excel.
They don't share common code.
--
Regards,
Tom Ogilvy
"PatFinegan " wrote in message
...
Dear Tom,
Thanks for pointing out the difference between orders of operation in
VBA and Excel.
However, to clarify, my first post c= -1^.5 should indeed have
generated an error because the square root of a negative number is
imaginary. I immediately regretted posting it because it cluttered two
very distinct issues -- the handling of imaginary numbers and a
computational inconsistency between Excel and VBA.
That's why I added a second equation, c = -1 ^ (1/3), because the cube
root of a negative number is not imaginary and should therefore not
result in an error. But as I wrote, the equation worked fine in an
Excel spreadsheet but bombed in VBA. It is that latter computational
discrepency that I find troubling, since the equation is definitely
"solvable". Sorry if that wasn't clear.
---
Message posted from http://www.ExcelForum.com/