// Copyright 2025 Gabriel Bjørnager Jensen.

#![cfg(test)]

use core::f32;
use core::f64;
use multitype::Float;

#[test]
fn test_float_next_up() {
	fn next_up<T: Float>(value: T) -> T {
		value.next_up()
	}

	assert_eq!(next_up(1.0f32).to_bits(), (1.0 + f32::EPSILON).to_bits());
	assert_eq!(next_up(1.0f64).to_bits(), (1.0 + f64::EPSILON).to_bits());

	#[cfg(feature = "f16")]
	assert_eq!(next_up(1.0f16).to_bits(), (1.0 + f16::EPSILON).to_bits());

	#[cfg(feature = "f128")]
	assert_eq!(next_up(1.0f128).to_bits(), (1.0 + f128::EPSILON).to_bits());
}
