Re: complex arithmetics
- From: "robin" <robin_v@xxxxxxxxxxx>
- Date: Tue, 08 Nov 2005 01:35:03 GMT
James Giles wrote in message ...
|robin wrote:
|...
|>> z = cmplx(real(z), 1.0, kind(z))
|>>
|>> This doesn't work because there is a spurious reference
|>> to the real part of Z. If the real part of Z is a signalling
|>> NaN, the above will fail with an exception for a reference
|>> that you didn't really even want to make.
|>
|> There is no arithmetic operation here, and there is no
|> reason for NaN being raised.
|> Indeed, the operation can be reduced to the simple
|> transfer of 1.0 after transfomation (if any) to the kind
|> of the imaginary part of Z. There is no need to touch
|> the real part of Z in this case.
|
|Yeah. That's your opinion. That's maybe even my
|opinion of what the rule *should* be. That's not
|necessarily any consolation when the problem arises
|and a vendor states that on the contrary a REAL(Z)
|function call *IS* an operation that they raise
|exceptions for. Probably could get support from
|the comittee for that position too. In any case,
|the following is much more legible, and is a
|superior language design if for only that reason:
|
| z%imag = 1.0
That's not particularly neat, and in any case,
it's an operation that's rarely called for.
|--
|J. Giles
.
- Follow-Ups:
- Re: complex arithmetics
- From: glen herrmannsfeldt
- Re: complex arithmetics
- References:
- Re: complex arithmetics
- From: robin
- Re: complex arithmetics
- From: James Giles
- Re: complex arithmetics
- Prev by Date: Re: Installing ATLAS and LAPACK
- Next by Date: Re: complex arithmetics
- Previous by thread: Re: complex arithmetics
- Next by thread: Re: complex arithmetics
- Index(es):
Relevant Pages
|
Loading