verify/AI/float128_test.nim

This documentation is automatically generated by online-judge-tools/verification-helper

:heavy_check_mark: verify/AI/float128_test.nim

Depends on

Code

# verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/problems/ITP1_1_A
echo "Hello World"

import cplib/math/float128

let a: float128 = 1.5
let b: float128 = 2
assert ((a + b).to_float - 3.5).abs < 1e-12
assert ((b - a).to_float - 0.5).abs < 1e-12
assert ((a * b).to_float - 3.0).abs < 1e-12
assert ((b / a).to_float - (4.0 / 3.0)).abs < 1e-12
assert (-a).to_float < 0
assert abs(-a) == a
assert cmp(a, b) < 0
assert b > a
assert a < b
assert a == a

doAssert not compiles(a mod b)
doAssert not compiles(a & b)
doAssert not compiles(a | b)
doAssert not compiles(a ^ b)
doAssert not compiles(a << b)
doAssert not compiles(a >> b)
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/nim.py", line 86, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page