@@ -7,18 +7,39 @@ macro_rules! implement {
77 where
88 Self : crate :: LanesAtMost32 ,
99 {
10- /// Returns the largest integer less than or equal to each lane.
10+ /// Returns the smallest integer greater than or equal to each lane.
11+ #[ must_use = "method returns a new vector and does not mutate the original value" ]
12+ #[ inline]
13+ pub fn ceil( self ) -> Self {
14+ unsafe { crate :: intrinsics:: simd_ceil( self ) }
15+ }
16+
17+ /// Returns the largest integer value less than or equal to each lane.
1118 #[ must_use = "method returns a new vector and does not mutate the original value" ]
1219 #[ inline]
1320 pub fn floor( self ) -> Self {
1421 unsafe { crate :: intrinsics:: simd_floor( self ) }
1522 }
1623
17- /// Returns the smallest integer greater than or equal to each lane .
24+ /// Rounds to the nearest integer value. Ties round toward zero .
1825 #[ must_use = "method returns a new vector and does not mutate the original value" ]
1926 #[ inline]
20- pub fn ceil( self ) -> Self {
21- unsafe { crate :: intrinsics:: simd_ceil( self ) }
27+ pub fn round( self ) -> Self {
28+ unsafe { crate :: intrinsics:: simd_round( self ) }
29+ }
30+
31+ /// Returns the floating point's integer value, with its fractional part removed.
32+ #[ must_use = "method returns a new vector and does not mutate the original value" ]
33+ #[ inline]
34+ pub fn trunc( self ) -> Self {
35+ unsafe { crate :: intrinsics:: simd_trunc( self ) }
36+ }
37+
38+ /// Returns the floating point's fractional value, with its integer part removed.
39+ #[ must_use = "method returns a new vector and does not mutate the original value" ]
40+ #[ inline]
41+ pub fn fract( self ) -> Self {
42+ self - self . trunc( )
2243 }
2344 }
2445
0 commit comments