bug with min/max and non-finite values [message #94701] |
Tue, 29 August 2017 01:42  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
IDL> aa=!values.f_infinity
IDL> bb=5
IDL> cc=min(aa,bb)
IDL> print, cc
Inf
Why is the MIN function returning the wrong value here? Same problem with MAX.
IDL> aa=-!values.f_infinity
IDL> bb=5
IDL> cc=max(aa,bb)
IDL> print, cc
-Inf
|
|
|
Re: bug with min/max and non-finite values [message #94702 is a reply to message #94701] |
Tue, 29 August 2017 01:45  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
On Tuesday, August 29, 2017 at 10:42:20 AM UTC+2, superchromix wrote:
> IDL> aa=!values.f_infinity
> IDL> bb=5
> IDL> cc=min(aa,bb)
> IDL> print, cc
> Inf
>
> Why is the MIN function returning the wrong value here? Same problem with MAX.
>
> IDL> aa=-!values.f_infinity
> IDL> bb=5
> IDL> cc=max(aa,bb)
> IDL> print, cc
> -Inf
Sorry, my mistake! I should have been writing min([aa,bb]). Working now.
|
|
|