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

Home » Public Forums » archive » Re: SIGN function: signof(num or array of num)
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: SIGN function: signof(num or array of num) [message #70134 is a reply to message #70133] Tue, 16 March 2010 09:17 Go to previous messageGo to previous message
Ding is currently offline  Ding
Messages: 20
Registered: March 2008
Junior Member
On Mar 16, 3:46 pm, Carsten Lechte <c...@toppoint.de> wrote:
> Ding wrote:
>> IDL> a=[[1,0][-1,0]]
>> IDL> print,signof(a)
>>      1  0
>>     -1  0
>
> Still, you should mention under RESTRICTIONS that the
> input must be an integer type:
>
> IDL> a=[[1,0],[-1,0]]
> IDL> print, signof(a)
>         1       0
>        -1       0
> % Program caused arithmetic error: Integer divide by 0
> IDL> print, signof(double(a))
>         1  -32768
>        -1  -32768
> % Program caused arithmetic error: Floating illegal operand
> IDL> print, signof(complex(a))
>         1  -32768
>        -1  -32768
> % Program caused arithmetic error: Floating illegal operand
>
> chl

This is all the information I have, including the !version:

IDL> print,!version
{ x86_64 linux unix linux 6.4 Apr 26 2007 64 64}
IDL> print,a
1 0
-1 0
IDL> print,double(a)
1.0000000 0.0000000
-1.0000000 0.0000000
IDL> print,complex(a)
( 1.00000, 0.00000)( 0.00000, 0.00000)
( -1.00000, 0.00000)( 0.00000, 0.00000)
IDL> print,signof(a)
1 0
-1 0
% Program caused arithmetic error: Integer divide by 0
IDL> print,signof(double(a))
1 0
-1 0
% Program caused arithmetic error: Floating illegal operand
IDL> print,signof(complex(a))
1 0
-1 0
% Program caused arithmetic error: Floating illegal operand
IDL>

Let's compare the version of the result and see if it is IDL or
processor that cause the difference!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to read data with format codes?
Next Topic: Predefined iTool Visualization in existing iTool

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

Current Time: Sun Oct 12 10:39:41 PDT 2025

Total time taken to generate the page: 0.80298 seconds