MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / FPVal

Function FPVal

lean_py/z3/core.py:3263–3272  ·  view source on GitHub ↗
(
    val: float | int | str,
    sort: FPSortRef | None = None,
    ctx: Context | None = None,
)

Source from the content-addressed store, hash-verified

3261
3262
3263def FPVal(
3264 val: float | int | str,
3265 sort: FPSortRef | None = None,
3266 ctx: Context | None = None,
3267) -> FPNumRef:
3268 if sort is None:
3269 sort = Float64()
3270 val = float(val) if isinstance(val, (int, str)) else val
3271 bits = struct.unpack("<Q", struct.pack("<d", val))[0]
3272 return FPNumRef(FpLitNode(bits, sort.ebits(), sort.sbits()), sort, frozenset())
3273
3274
3275def fpNaN(sort: FPSortRef, ctx: Context | None = None) -> FPNumRef:

Callers 15

test_fpvalMethod · 0.90
test_is_fp_valueMethod · 0.90
test_fp_add_groundMethod · 0.90
test_fp_mul_groundMethod · 0.90
test_fp_neg_groundMethod · 0.90
test_addMethod · 0.90
test_subMethod · 0.90

Calls 5

FpLitNodeClass · 0.90
Float64Function · 0.85
FPNumRefClass · 0.85
ebitsMethod · 0.45
sbitsMethod · 0.45

Tested by 15

test_fpvalMethod · 0.72
test_is_fp_valueMethod · 0.72
test_fp_add_groundMethod · 0.72
test_fp_mul_groundMethod · 0.72
test_fp_neg_groundMethod · 0.72
test_addMethod · 0.72
test_subMethod · 0.72