MCPcopy Index your code
hub / github.com/algorithmicsuperintelligence/optillm / numerically_equal

Function numerically_equal

scripts/eval_math500_benchmark.py:108–113  ·  view source on GitHub ↗

Compare if two numeric strings represent the same value.

(str1: str, str2: str)

Source from the content-addressed store, hash-verified

106 return num_str
107
108def numerically_equal(str1: str, str2: str) -> bool:
109 """Compare if two numeric strings represent the same value."""
110 try:
111 return abs(float(str1) - float(str2)) < 1e-10
112 except:
113 return False
114
115def normalize_fraction(fraction_str: str) -> str:
116 """Helper function to normalize fractions."""

Callers 1

compare_answersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected