Skip to content

Commit baf962a

Browse files
Address CodeRabbit review: clarify threshold boundary test comment
The comment claimed all three assertions stay in non-scientific form, but the 1e-5 case explicitly verifies scientific notation (since |1e-5| < 1e-4 falls outside the decimal-form range). Reworded the header to describe the axis being tested (threshold boundary) and added per-case inline notes indicating each assertion's expected form.
1 parent 962c20f commit baf962a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

extra_tests/snippets/builtin_complex.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,12 @@ class complex_subclass(complex):
251251
assert repr(1 + 1e100j) == "(1+1e+100j)"
252252
assert repr(1e100 + 1j) == "(1e+100+1j)"
253253

254-
# Values at the threshold boundaries must stay in non-scientific form.
255-
assert repr(1e15 + 1j) == "(1000000000000000+1j)"
256-
assert repr(1e-4 + 1j) == "(0.0001+1j)"
257-
assert repr(1e-5 + 1j) == "(1e-05+1j)"
254+
# Threshold boundary: |x| in [1e-4, 1e16) renders in decimal form; values
255+
# outside that range use scientific notation. These three assertions pin
256+
# the exact transition points.
257+
assert repr(1e15 + 1j) == "(1000000000000000+1j)" # below 1e16 -> decimal
258+
assert repr(1e-4 + 1j) == "(0.0001+1j)" # at 1e-4 (inclusive) -> decimal
259+
assert repr(1e-5 + 1j) == "(1e-05+1j)" # below 1e-4 -> scientific
258260

259261
# Integer-valued components render without trailing ".0".
260262
assert repr(1 + 2j) == "(1+2j)"

0 commit comments

Comments
 (0)