All examplesLanguage Install Aner
Local approximate comparison policies
Compare binary numerical results under immutable local tolerances and inspect nested scope and helper isolation.
print(0.1 + 0.2 == 0.3)
print(0.1 + 0.2 ~== 0.3)
print(1e-12 ~== 0.0)
fn helper() -> Bool { return 1e-12 ~== 0.0 }
var absolute_tolerance = 1e-10
approx(relative: 0.0, absolute: absolute_tolerance) {
print(1e-12 ~== 0.0)
absolute_tolerance = 0.0
print(1e-12 ~== 0.0)
approx(relative: 0.0, absolute: 0.0) {
print(1e-12 ~== 0.0)
}
print(helper())
}
print(1e-12 ~== 0.0)
Make it your experiment.
Use a compatible Aner runtime. Save this program as examples/approx_comparison.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/approx_comparison.aner
aner run examples/approx_comparison.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Use a compatible current native Aner executable. This complete example runs locally with the declared inputs; the guide explains exact shapes, expected results and resource limits.
Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution