import numpy as np
import ctypes
FE_TONEAREST = 0
FE_DOWNWARD = 1024
FE_UPWARD = 2048
FE_TOWARDZERO = 3072
libc = ctypes.CDLL('libc.dylib')
v = 1.0 / (1 << 23)
print(repr(np.float32(1 + v) - np.float32(v / 2)))
libc.fesetround(FE_UPWARD)
print(repr(np.float32(1 + v) - np.float32(v / 2)))
Ничья в раунде с numpy