MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / float_f64_comparison

Function float_f64_comparison

tests/integration/vm_execution.rs:2399–2419  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2397 r#"
2398main: () -> i32 {
2399 a: f32 = 1.5
2400 b: f32 = 2.5
2401 c: f32 = a + b
2402 return c as i32
2403}
2404"#,
2405 );
2406 assert!(
2407 matches!(outcome, RunOutcome::Halted(4)),
2408 "expected Halted(4), got {outcome:?}"
2409 );
2410}
2411
2412#[test]
2413fn float_f64_arithmetic_uses_fpu() {
2414 // Before the fix, f64 math fell through to the integer ALU and operated on
2415 // raw bit patterns. Correct: 3.5 * 2.0 = 7.0 -> 7.
2416 let (_, outcome, _) = run_hll(
2417 r#"
2418main: () -> i32 {
2419 a: f64 = 3.5
2420 b: f64 = 2.0
2421 c: f64 = a * b
2422 return c as i32

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected