about summary refs log tree commit diff
path: root/library/compiler-builtins/libm/src/math/generic/fdim.rs
blob: 289e5fd96f86ab8a78ed25afc8d0a6c1bbf739e6 (plain)
1
2
3
4
5
6
use crate::support::Float;

#[inline]
pub fn fdim<F: Float>(x: F, y: F) -> F {
    if x <= y { F::ZERO } else { x - y }
}