File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -34,5 +34,6 @@ disallowed-methods = [
34
34
{ path = " f32::copysign" , reason = " use ops::copysign instead for no_std compatibility" },
35
35
{ path = " f32::round" , reason = " use ops::round instead for no_std compatibility" },
36
36
{ 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" },
37
38
{ path = " f32::fract" , reason = " use ops::fract instead for no_std compatibility" },
38
39
]
Original file line number Diff line number Diff line change @@ -510,6 +510,14 @@ mod libm_ops_for_no_std {
510
510
libm:: floorf ( x)
511
511
}
512
512
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
+
513
521
/// Returns the fractional part of `x`.
514
522
///
515
523
/// This function always returns the precise result.
@@ -581,6 +589,14 @@ mod std_ops_for_no_std {
581
589
f32:: floor ( x)
582
590
}
583
591
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
+
584
600
/// Returns the fractional part of `x`.
585
601
///
586
602
/// This function always returns the precise result.
You can’t perform that action at this time.
0 commit comments