viirya commented on code in PR #3155:
URL: https://github.com/apache/arrow-rs/pull/3155#discussion_r1031295553
##########
arrow-array/src/arithmetic.rs:
##########
@@ -45,61 +45,83 @@ pub trait ArrowNativeTypeOp: ArrowNativeType {
/// The multiplicative identity
const ONE: Self;
+ /// A checked add operation
fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping add operation
fn add_wrapping(self, rhs: Self) -> Self;
+ /// A checked subtract operation
fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping subtract operation
fn sub_wrapping(self, rhs: Self) -> Self;
+ /// A checked multiplication operation
fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping multiplication operation
fn mul_wrapping(self, rhs: Self) -> Self;
+ /// A checked division operation
fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping division operation
fn div_wrapping(self, rhs: Self) -> Self;
+ /// A checked modulo operation
Review Comment:
```suggestion
/// Checked remainder operation
```
##########
arrow-array/src/arithmetic.rs:
##########
@@ -45,61 +45,83 @@ pub trait ArrowNativeTypeOp: ArrowNativeType {
/// The multiplicative identity
const ONE: Self;
+ /// A checked add operation
fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping add operation
fn add_wrapping(self, rhs: Self) -> Self;
+ /// A checked subtract operation
fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping subtract operation
fn sub_wrapping(self, rhs: Self) -> Self;
+ /// A checked multiplication operation
fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping multiplication operation
fn mul_wrapping(self, rhs: Self) -> Self;
+ /// A checked division operation
fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping division operation
fn div_wrapping(self, rhs: Self) -> Self;
+ /// A checked modulo operation
fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>;
+ /// A wrapping modulo operation
Review Comment:
```suggestion
/// Wrapping remainder operation
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]