File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
hypothesis-python/src/hypothesis/strategies/_internal Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,16 @@ def __init__(
206206 ):
207207 super ().__init__ ()
208208 assert isinstance (allow_nan , bool )
209- assert smallest_nonzero_magnitude > 0.0
209+ assert smallest_nonzero_magnitude >= 0.0 , "programmer error if this is negative"
210+ if smallest_nonzero_magnitude == 0.0 : # pragma: no cover
211+ raise FloatingPointError (
212+ "Got allow_subnormal=True, but we can't represent subnormal floats "
213+ "right now, in violation of the IEEE-754 floating-point "
214+ "specification. This is usually because something was compiled with "
215+ "-ffast-math or a similar option, which sets global processor state. "
216+ "See https://simonbyrne.github.io/notes/fastmath/ for a more detailed "
217+ "writeup - and good luck!"
218+ )
210219 self .min_value = min_value
211220 self .max_value = max_value
212221 self .allow_nan = allow_nan
You can’t perform that action at this time.
0 commit comments