@@ -207,21 +207,29 @@ def type_info(np_type):
207
207
if np_type in (_float16 , np .float32 , np .float64 ,
208
208
np .complex64 , np .complex128 ):
209
209
return ret
210
+ info_64 = np .finfo (np .float64 )
210
211
if dt .kind == 'c' :
211
212
assert np_type is np .longcomplex
212
213
vals = (nmant , nexp , width / 2 )
213
214
else :
214
215
assert np_type is np .longdouble
215
216
vals = (nmant , nexp , width )
216
217
if vals in ((112 , 15 , 16 ), # binary128
218
+ (info_64 .nmant , info_64 .nexp , 8 ), # float64
217
219
(63 , 15 , 12 ), (63 , 15 , 16 )): # Intel extended 80
218
220
pass # these are OK
221
+ elif vals in ((52 , 15 , 12 ), # windows float96
222
+ (52 , 15 , 16 )): # windows float128?
223
+ # On windows 32 bit at least, float96 appears to be a float64 padded to
224
+ # 96 bits. The nexp == 15 is the same as for intel 80 but nexp in fact
225
+ # appears to be 11 as for float64
226
+ return dict (min = np_type (info_64 .min ), max = np_type (info_64 .max ),
227
+ nmant = info_64 .nmant , nexp = info_64 .nexp , width = width )
219
228
elif vals == (1 , 1 , 16 ) and processor () == 'powerpc' : # broken PPC
220
- dbl_info = np .finfo (np .float64 )
221
- return dict (min = np_type (dbl_info .min ), max = np_type (dbl_info .max ),
229
+ return dict (min = np_type (info_64 .min ), max = np_type (info_64 .max ),
222
230
nmant = 106 , nexp = 11 , width = width )
223
231
else : # don't recognize the type
224
- raise FloatingError ('We had not expected this type' )
232
+ raise FloatingError ('We had not expected type %s' % np_type )
225
233
return ret
226
234
227
235
0 commit comments