File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -249,26 +249,7 @@ def flt2nmant(flt_type):
249
249
return _flt_nmant [flt_type ]
250
250
except KeyError :
251
251
pass
252
- fi = np .finfo (flt_type )
253
- nmant , nexp = fi .nmant , fi .nexp
254
- # Assuming the np.float type is always IEEE 64 bit
255
- if flt_type is np .float and (nmant , nexp ) == (52 , 11 ):
256
- return 52
257
- # Now we should be testing long doubles
258
- assert flt_type is np .longdouble
259
- if (nmant , nexp ) == (63 , 15 ): # 80-bit intel type
260
- return 63 # Not including explicit first digit
261
- # We test the declared nmant by stepping up and down. These tests assume a
262
- # binary format
263
- i_end_contig = 2 ** (nmant + 1 ) # int
264
- f_end_contig = flt_type (i_end_contig )
265
- # We need as_int here because long doubles do not necessarily convert
266
- # correctly to ints with int() - see
267
- # http://projects.scipy.org/numpy/ticket/1395
268
- if as_int (f_end_contig - 1 ) == (i_end_contig - 1 ): # still representable
269
- if as_int (f_end_contig + 1 ) == i_end_contig : # Rounding down
270
- return nmant
271
- raise FloatingError ('Cannot be confident of nmant value for %s' % flt_type )
252
+ return type_info (flt_type )['nmant' ]
272
253
273
254
274
255
def as_int (x , check = True ):
You can’t perform that action at this time.
0 commit comments