The TYPEMIN function returns the minimum allowed value for an IDL data type.
Examples
IDL> types = [1,2,3,4,5,6,9,12,13,14,15]
IDL> foreach type, types do help, TYPEMIN(type)
<Expression> BYTE = 0
<Expression> INT = -32768
<Expression> LONG = -2147483648
<Expression> FLOAT = 1.17549e-38
<Expression> DOUBLE = 2.2250739e-308
<Expression> COMPLEX = ( 1.17549e-38, 1.17549e-38)
<Expression> DCOMPLEX = ( 2.2250739e-308, 2.2250739e-308)
<Expression> UINT = 0
<Expression> ULONG = 0
<Expression> LONG64 = -9223372036854775808
<Expression> ULONG64 = 0
IDL> print, TYPEMIN(/long64)
-9223372036854775808
Syntax
Result = TYPEMIN( Type /BYTE, /INT, /LONG, /FLOAT, /DOUBLE, /COMPLEX, /DCOMPLEX, /UINT, /ULONG, /LONG64, /ULONG64)
Return Value
The result is a scalar number of the same data type that contains the minimum value.
Arguments
Type
Set this optional argument to an integer giving the IDL type code. If this argument is not set then one of the type keywords must be set. Possible values are:
| Type |
Name |
Result |
| 1 |
Byte |
0 |
| 2 |
Short integer |
-32768 |
| 3 |
Long integer |
-2147483648 |
| 4 |
Float |
1.17549e-38 |
| 5 |
Double |
2.2250739e-308 |
| 6 |
Complex |
( 1.17549e-38, 1.17549e-38)
|
| 9 |
Double complex |
( 2.2250739e-308, 2.2250739e-308) |
| 12 |
Unsigned short integer |
0 |
| 13 |
Unsigned long integer
|
0 |
| 14 |
64-bit integer |
-9223372036854775808 |
| 15 |
Unsigned 64-bit integer
|
0 |
Keywords
BYTE
Set this keyword to return the minimum value for a byte number. This is 0.
INT
Set this keyword to return the minimum value for a short integer. This is –32768.
LONG
Set this keyword to return the minimum value for a long integer. This is –2147483648.
FLOAT
Set this keyword to return the minimum value for a single-precision floating-point number. This is 1.17549e-38.
Note: This returns the smallest possible number. To retrieve the most negative number, use –TYPEMAX(/FLOAT).
DOUBLE
Set this keyword to return the minimum value for a double-precision floating-point number. This is 2.2250739e-308.
Note: This returns the smallest possible number. To retrieve the most negative number, use –TYPEMAX(/DOUBLE).
COMPLEX
Set this keyword to return the minimum value for a single-precision complex number. This is complex(1.17549e-38, 1.17549e-38).
Note: This returns the smallest possible number. To retrieve the most negative number, use –TYPEMAX(/COMPLEX).
DCOMPLEX
Set this keyword to return the minimum value for a double-precision number. This is dcomplex(2.2250739e-308, 2.2250739e-308).
Note: This returns the smallest possible number. To retrieve the most negative number, use –TYPEMAX(/DCOMPLEX).
UINT
Set this keyword to return the minimum value for an unsigned short integer. This is 0.
ULONG
Set this keyword to return the minimum value for an unsigned long integer. This is 0.
LONG64
Set this keyword to return the minimum value for a 64-bit integer. This is –9223372036854775808.
ULONG64
Set this keyword to return the minimum value for an unsigned 64-bit integer. This is 0.
Version History
See Also
MACHAR, TYPEMAX