File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -34,5 +34,6 @@ disallowed-methods = [
3434 { path = " f32::copysign" , reason = " use ops::copysign instead for no_std compatibility" },
3535 { path = " f32::round" , reason = " use ops::round instead for no_std compatibility" },
3636 { path = " f32::floor" , reason = " use ops::floor instead for no_std compatibility" },
37+ { path = " f32::ceil" , reason = " use ops::ceil instead for no_std compatibility" },
3738 { path = " f32::fract" , reason = " use ops::fract instead for no_std compatibility" },
3839]
Original file line number Diff line number Diff line change @@ -510,6 +510,14 @@ mod libm_ops_for_no_std {
510510 libm:: floorf ( x)
511511 }
512512
513+ /// Returns the smallest integer greater than or equal to `x`.
514+ ///
515+ /// Precision is specified when the `libm` feature is enabled.
516+ #[ inline( always) ]
517+ pub fn ceil ( x : f32 ) -> f32 {
518+ libm:: ceilf ( x)
519+ }
520+
513521 /// Returns the fractional part of `x`.
514522 ///
515523 /// This function always returns the precise result.
@@ -581,6 +589,14 @@ mod std_ops_for_no_std {
581589 f32:: floor ( x)
582590 }
583591
592+ /// Returns the smallest integer greater than or equal to `x`.
593+ ///
594+ /// This function always returns the precise result.
595+ #[ inline( always) ]
596+ pub fn ceil ( x : f32 ) -> f32 {
597+ f32:: ceil ( x)
598+ }
599+
584600 /// Returns the fractional part of `x`.
585601 ///
586602 /// This function always returns the precise result.
You can’t perform that action at this time.
0 commit comments