f



Some IDL_Number documentation quirks

A few quirks in the IDL documentation for IDL_Number

http://www.harrisgeospatial.com/docs/IDL_Number.html

1.  The example for IDL_Number::Median method reads
*********
Print the median value of a number:

num = -24601

PRINT, num.Median( )

IDL prints:

24601
**********
Huh?    The median of a negative scalar is its absolute value?    I then realized that this example is probably an unfinished copy/paste from the IDL_Number:Signum method.  But

2. The example for IDL Number::Signum is incorrect

*********************************
Print the signum value of a number:

num = -24601

PRINT, num.Signum( )

IDL prints:

24601
***********************************
This is closer but still incorrect.   The value of num.signum() should be -1 (the sign of the number).

3. The documentation of IDL_Number::Total is incomplete.

**************
Arguments

None.
Keywords

None.
***********

But in fact, although not documented, the dimension argument and five keywords available to the TOTAL() function are also available to IDL_Number::Total.    For example

IDL> a = indgen(3,3)
IDL> a
       0       1       2
       3       4       5
       6       7       8
IDL> a.total(1,/integer) 
                     3                    12                    21
0
wlandsman
12/2/2016 7:14:50 PM
comp.lang.idl-pvwave 12260 articles. 4 followers. Post Follow

2 Replies
403 Views

Similar Articles

[PageSpeed] 1

On Friday, December 2, 2016 at 12:14:52 PM UTC-7, wlandsman wrote:
> A few quirks in the IDL documentation for IDL_Number
> 
> http://www.harrisgeospatial.com/docs/IDL_Number.html
> 
> 1.  The example for IDL_Number::Median method reads
> *********
> Print the median value of a number:
> 
> num = -24601
> 
> PRINT, num.Median( )
> 
> IDL prints:
> 
> 24601
> **********
> Huh?    The median of a negative scalar is its absolute value?    I then realized that this example is probably an unfinished copy/paste from the IDL_Number:Signum method.  But
> 
> 2. The example for IDL Number::Signum is incorrect
> 
> *********************************
> Print the signum value of a number:
> 
> num = -24601
> 
> PRINT, num.Signum( )
> 
> IDL prints:
> 
> 24601
> ***********************************
> This is closer but still incorrect.   The value of num.signum() should be -1 (the sign of the number).
> 
> 3. The documentation of IDL_Number::Total is incomplete.
> 
> **************
> Arguments
> 
> None.
> Keywords
> 
> None.
> ***********
> 
> But in fact, although not documented, the dimension argument and five keywords available to the TOTAL() function are also available to IDL_Number::Total.    For example
> 
> IDL> a = indgen(3,3)
> IDL> a
>        0       1       2
>        3       4       5
>        6       7       8
> IDL> a.total(1,/integer) 
>                      3                    12                    21

Whoops, my bad. Thanks Wayne for catching all of these. They'll be fixed in IDL Next (not 8.6). You can also use the Dimension argument to the IDL_Number::Product method.
Cheers,
Chris
Harris Geospatial Solutions
0
Chris
12/7/2016 10:17:14 PM
There were also some problems in the documentation for BitGet and BitSet, which Wayne and me talked about in an earlier thread:

https://groups.google.com/d/msg/comp.lang.idl-pvwave/bM6iI_7Y1mE/f2S0WkJ7AwAJ

On Wednesday, December 7, 2016 at 2:17:16 PM UTC-8, Chris Torrence wrote:
> On Friday, December 2, 2016 at 12:14:52 PM UTC-7, wlandsman wrote:
> > A few quirks in the IDL documentation for IDL_Number
> > 
> > http://www.harrisgeospatial.com/docs/IDL_Number.html
> > 
> > 1.  The example for IDL_Number::Median method reads
> > *********
> > Print the median value of a number:
> > 
> > num = -24601
> > 
> > PRINT, num.Median( )
> > 
> > IDL prints:
> > 
> > 24601
> > **********
> > Huh?    The median of a negative scalar is its absolute value?    I then realized that this example is probably an unfinished copy/paste from the IDL_Number:Signum method.  But
> > 
> > 2. The example for IDL Number::Signum is incorrect
> > 
> > *********************************
> > Print the signum value of a number:
> > 
> > num = -24601
> > 
> > PRINT, num.Signum( )
> > 
> > IDL prints:
> > 
> > 24601
> > ***********************************
> > This is closer but still incorrect.   The value of num.signum() should be -1 (the sign of the number).
> > 
> > 3. The documentation of IDL_Number::Total is incomplete.
> > 
> > **************
> > Arguments
> > 
> > None.
> > Keywords
> > 
> > None.
> > ***********
> > 
> > But in fact, although not documented, the dimension argument and five keywords available to the TOTAL() function are also available to IDL_Number::Total.    For example
> > 
> > IDL> a = indgen(3,3)
> > IDL> a
> >        0       1       2
> >        3       4       5
> >        6       7       8
> > IDL> a.total(1,/integer) 
> >                      3                    12                    21
> 
> Whoops, my bad. Thanks Wayne for catching all of these. They'll be fixed in IDL Next (not 8.6). You can also use the Dimension argument to the IDL_Number::Product method.
> Cheers,
> Chris
> Harris Geospatial Solutions

0
Paulo
12/8/2016 12:36:16 AM
Reply: