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

Home » Public Forums » archive » bug with min/max and non-finite values
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
bug with min/max and non-finite values [message #94701] Tue, 29 August 2017 01:42 Go to next message
markb77 is currently offline  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 Go to previous message
markb77 is currently offline  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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: HDF_SD_ADDDATA error attempting to copy variable from one HDF file to another
Next Topic: python bridge setup - IDL8.6.1 Mac OS X Sierra

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

Current Time: Wed Oct 08 09:13:36 PDT 2025

Total time taken to generate the page: 0.01080 seconds