comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: conditional operator
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: conditional operator [message #63579 is a reply to message #63575] Fri, 14 November 2008 09:23 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Nov 14, 3:14 am, greg.a...@googlemail.com wrote:
> It seems odd to me that you can't apply the conditional operator "?"
> to an array:
>
> threshold = (image gt z) ? 0b:255b
>
> It's not hard to find another way, but this would be more elegant.

Yes, I agree. I've wanted a vectorized ?: operator for a while. I
suppose the reason is that the "cond" in:

if cond then statement

must be a scalar, but it doesn't seem like ?: has the same
restrictions of an IF statement.

Also, vectorized versions of ~, &&, and || would be nice.

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: type conversion string -> float
Next Topic: ncdf string array dimension

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 11:13:39 PDT 2025

Total time taken to generate the page: 1.52288 seconds