
Hi all, Is there some way in numarray to find out what the maximum and minimum values are that a type can hold? For instance, is there a convenient way to find out what the maximal possible value of the Float32 type is? Cheers, Peter -- Dr. Peter J. Verveer Cell Biology and Cell Biophysics Programme EMBL Meyerhofstrasse 1 D-69117 Heidelberg Germany Tel. : +49 6221 387245 Fax : +49 6221 387242 Email: Peter.Verveer@embl-heidelberg.de

On Mon, 2003-09-01 at 04:43, Peter Verveer wrote:
Hi all,
Is there some way in numarray to find out what the maximum and minimum values are that a type can hold?
I think the answer is "no". I added a feature request on Source Forge.
For instance, is there a convenient way to find out what the maximal possible value of the Float32 type is?
Nope.
Cheers, Peter -- Todd Miller <jmiller@stsci.edu>

On Mon, 1 Sep 2003, Peter Verveer wrote:
Is there some way in numarray to find out what the maximum and minimum values are that a type can hold? For instance, is there a convenient way to find out what the maximal possible value of the Float32 type is?
I am not completely sure what is behind of the following way but
numarray.fromstring('\xff\xff\x7f\x7f','f') array([ 3.40282347e+38], type=Float32)
seems to give the maximum value for Float32. Pearu

On Monday 01 September 2003 14:55, Pearu Peterson wrote:
On Mon, 1 Sep 2003, Peter Verveer wrote:
Is there some way in numarray to find out what the maximum and minimum values are that a type can hold? For instance, is there a convenient way to find out what the maximal possible value of the Float32 type is?
I am not completely sure what is behind of the following way but
numarray.fromstring('\xff\xff\x7f\x7f','f')
array([ 3.40282347e+38], type=Float32)
seems to give the maximum value for Float32.
Pearu
Sure, it is not too difficult to find the minimum and maximum values of each type, given the bitsize (although there may be portability issues). But it would be convenient to have such properties directly accessible in numarray, I think. Peter
participants (3)
-
Pearu Peterson
-
Peter Verveer
-
Todd Miller