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

Function assert_finfo_equal

numpy/core/tests/test_getlimits.py:44–51  ·  view source on GitHub ↗
(f1, f2)

Source from the content-addressed store, hash-verified

42 assert_equal(id(ftype), id(ftype2))
43
44def assert_finfo_equal(f1, f2):
45 # assert two finfo instances have the same attributes
46 for attr in ('bits', 'eps', 'epsneg', 'iexp', 'machep',
47 'max', 'maxexp', 'min', 'minexp', 'negep', 'nexp',
48 'nmant', 'precision', 'resolution', 'tiny',
49 'smallest_normal', 'smallest_subnormal'):
50 assert_equal(getattr(f1, attr), getattr(f2, attr),
51 f'finfo instances {f1} and {f2} differ on {attr}')
52
53def assert_iinfo_equal(i1, i2):
54 # assert two iinfo instances have the same attributes

Callers 2

test_basicMethod · 0.85
test_instancesFunction · 0.85

Calls 1

assert_equalFunction · 0.90

Tested by

no test coverage detected