@@ -7,18 +7,39 @@ macro_rules! implement {
7
7
where
8
8
Self : crate :: LanesAtMost32 ,
9
9
{
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.
11
18
#[ must_use = "method returns a new vector and does not mutate the original value" ]
12
19
#[ inline]
13
20
pub fn floor( self ) -> Self {
14
21
unsafe { crate :: intrinsics:: simd_floor( self ) }
15
22
}
16
23
17
- /// Returns the smallest integer greater than or equal to each lane .
24
+ /// Rounds to the nearest integer value. Ties round toward zero .
18
25
#[ must_use = "method returns a new vector and does not mutate the original value" ]
19
26
#[ 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( )
22
43
}
23
44
}
24
45
0 commit comments