From bug-octave-request at bevo dot che dot wisc dot edu Thu Apr 1 11:56:06 1999 Subject: Re: bug with negative numbers and power From: "John W. Eaton" To: Thomas Walter Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 1 Apr 1999 11:55:59 -0600 (CST) On 1-Apr-1999, Thomas Walter wrote: | The number 'a = -8' is real not complex. And the solution of | the third root of '-8' has _only_ in the complex plain three solutions. | In the real plain there is only one. | If I interprete your lines correct: | Does this mean if there is a wrapper function 'root (x, n)' with 'n' | is an integer then the problem vanishes? No. If I remember correctly, the n-th root of any number has n solutions. | This leads to another question: | How to distinguish between integer and real values in octave? I think if (round (x) == x) should work. But be careful. Don't use != to invert the meaning of this test if x is a vector or matrix. jwe <