我有一个Python float,我想拥有float1个ULP更大更小的s .
float
在Java中,我会用Math.nextUp(x)和来做Math.nextAfter(x, Double.NEGATIVE_INFINITY).
Math.nextUp(x)
Math.nextAfter(x, Double.NEGATIVE_INFINITY)
有没有办法在Python中执行此操作?我想过自己实现它math.frexp,math.ldexp但据我所知,Python没有指定浮点类型的大小.
math.frexp
math.ldexp
python floating-point
floating-point ×1
python ×1