MCPcopy Create free account
hub / github.com/apache/arrow / MultiplyWithOverflow

Function MultiplyWithOverflow

cpp/src/arrow/util/int_util_overflow.h:204–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203template <typename Int>
204std::optional<Int> MultiplyWithOverflow(std::initializer_list<Int> vs) {
205 if (vs.size() == 0) {
206 return {};
207 }
208 auto it = vs.begin();
209 Int v = *it++;
210 while (it != vs.end()) {
211 if (ARROW_PREDICT_FALSE(MultiplyWithOverflowGeneric(v, *it++, &v))) {
212 return {};
213 }
214 }
215 return v;
216}
217
218// Define function NegateWithOverflow with the signature `bool(T u, T* out)`
219// where T is a signed integer type. On overflow, these functions return true.

Callers 15

FieldMethod · 0.85
ConvertMethod · 0.85
ComputeRowMajorStridesFunction · 0.85
ComputeTensorSizeFunction · 0.85
ToTensorImplFunction · 0.85
AppendTimestampBatchFunction · 0.85
ComputeNumBytesMethod · 0.85
StridesInBytesFunction · 0.85

Calls 4

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TESTFunction · 0.68