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 85123c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions caffeine/microbenchmarks/bench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def cache_in_redis(num):


bench_flt_typical = NanoBenchmark(
"""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 85123c3

Please sign in to comment.