Skip to content

Commit

Permalink
fix: rounding method is not typically specified!
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Dec 19, 2024
1 parent 3785c65 commit 6a79032
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion caffeine/microbenchmarks/bench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ def cache_in_redis(num):


bench_flt_typical = NanoBenchmark(
"""flt(x, 2, rounding_method="Banker's Rounding")""",
"""flt(x, 2)""",
setup="x = random.uniform(1, 10000)",
globals={"flt": flt, "random": random},
)

# Rarely this is specified in code.
# But certain hot loops can benefit from this.
bench_flt_explicit_rounding = NanoBenchmark(
"""flt(x, 2, rounding_method='Banker's Rounding')""",
setup="x = random.uniform(1, 10000)",
globals={"flt": flt, "random": random},
)
Expand Down

0 comments on commit 6a79032

Please sign in to comment.