// ---
// tags: trop, source
// crystal-type: source
// crystal-domain: comp
// ---
//! Tropical semiring element.
//!
//! The tropical semiring (min, +) over u64:
//! - Tropical addition: a + b = min(a, b)
//! - Tropical multiplication: a * b = a + b (ordinary addition)
//! - Additive identity (ZERO): +inf (u64::MAX)
//! - Multiplicative identity (ONE): 0
/// A tropical semiring element wrapping a `u64`.
///
/// `u64::MAX` represents +inf (tropical zero, the additive identity).
/// `0` represents tropical one (the multiplicative identity).
;
/// Display a tropical element: finite values print as integers, infinity as "+inf".
trop/rs/src/element.rs
ฯ 0.0%