omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / bench / inference_cost / tasks / task10 / reference.rs
| 1 | fn is_prime_u32(n: u32) -> u32 { |
| 2 | if n < 2 { return 0; } |
| 3 | if n % 2 == 0 { return if n == 2 { 1 } else { 0 }; } |
| 4 | let mut d = 3u64; |
| 5 | while d * d <= n as u64 { if (n as u64) % d == 0 { return 0; } d += 2; } |
| 6 | 1 |
| 7 | } |