Re: how can I return nothing?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 20 Sep 2007 12:54:06 -0700
Michal Nazarewicz <mina86@xxxxxxx> writes:
richard@xxxxxxxxxxxxxxx (Richard Tobin) writes:
In article <1xgzve9ftnef0.qkfno80gbnsf.dlg@xxxxxxxxxx>,
Coos Haak <chforth@xxxxxxxxx> wrote:
i nor -i is the square root of -1.
What makes you think that?
The same thing I've pointed. In real number domain a square root of
x is defined to be _nonnegative_ number which squared gives x. You
cannot apply analogical definitions to complex numbers since there is no
such think as nonnegative complex number (or nonpositive for that
matter).
If the square root function is defined simply as the number (or a
number) whose square is the argument, then every non-zero number,
real, imaginary, or complex, has two possible square roots.
By convention, for positive real values, the positive value is
considered to be the principle square root (I think that's the right
terminology); sqrt(4) == 2, sqrt(4) != -2.
I *think* there's also a mathematical convention for choosing the
principle square root for imaginary and complex operands. I'm not
certain of that, and the convention could vary among different
branches of mathematics, or even among different mathematicians. But
C defines a csqrt() function that yields the complex square root of a
complex operand, and that function definitely defines a convention for
choosing one value when there are two possibilities. C99 7.3.8.3:
The csqrt functions compute the complex square root of z, with a
branch cut along the negative real axis.
The csqrt functions return the complex square root value, in the
range of the right halfplane (including the imaginary axis).
I *think* that's consistent with conventional mathematical usage; that
certainly should be the intent.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- References:
- how can I return nothing?
- From: xicloid
- Re: how can I return nothing?
- From: Keith Thompson
- Re: how can I return nothing?
- From: Richard Tobin
- Re: how can I return nothing?
- From: Coos Haak
- Re: how can I return nothing?
- From: Richard Tobin
- Re: how can I return nothing?
- From: Michal Nazarewicz
- how can I return nothing?
- Prev by Date: Re: Difference between a MACRO and a FUNCTION
- Next by Date: Re: Struct size
- Previous by thread: Re: how can I return nothing?
- Next by thread: Re: how can I return nothing?
- Index(es):
Relevant Pages
|
Loading