MCPcopy Create free account
hub / github.com/numpy/numpy / _discovered_machar

Function _discovered_machar

numpy/core/getlimits.py:364–375  ·  view source on GitHub ↗

Create MachAr instance with found information on float types TODO: MachAr should be retired completely ideally. We currently only ever use it system with broken longdouble (valgrind, WSL).

(ftype)

Source from the content-addressed store, hash-verified

362
363
364def _discovered_machar(ftype):
365 """ Create MachAr instance with found information on float types
366
367 TODO: MachAr should be retired completely ideally. We currently only
368 ever use it system with broken longdouble (valgrind, WSL).
369 """
370 params = _MACHAR_PARAMS[ftype]
371 return MachAr(lambda v: array([v], ftype),
372 lambda v:_fr0(v.astype(params['itype']))[0],
373 lambda v:array(_fr0(v)[0], ftype),
374 lambda v: params['fmt'] % array(_fr0(v)[0], ftype),
375 params['title'])
376
377
378@set_module('numpy')

Callers 3

test_known_typesFunction · 0.90
test_subnormal_warningFunction · 0.90
_get_macharFunction · 0.85

Calls 4

arrayFunction · 0.90
MachArClass · 0.85
_fr0Function · 0.85
astypeMethod · 0.80

Tested by 2

test_known_typesFunction · 0.72
test_subnormal_warningFunction · 0.72