code wiki / (root) / nx_fx_f64_elide.nx

nx_fx_f64_elide.nx source

↩ module page · 9 lines · 296 B

1// nx_fx_f64_elide.nx -- Checks if a mapped memory region contains a non-zero value at index 1 when index 0 is zero. 2import "nx_syscalls.nx" 3func main() -> i64 { 4 let p: *f64 = sys_mmap(32) as *f64 5 p[0] = 0.0 6 p[1] = 2.5 7 if p[1] > 0.0 { if p[0] == 0.0 { return 0 } } 8 return 1 9}