|
| template<class T> |
| static bool | CanNegate (T input) |
| template<class TA, class TR> |
| static TR | Operation (TA input) |
◆ CanNegate() [1/3]
template<class T>
| bool duckdb::NegateOperator::CanNegate |
( |
T | input | ) |
|
|
inlinestatic |
228089 {
228090 using Limits = NumericLimits<T>;
228091 return !(Limits::IsSigned() && Limits::Minimum() == input);
228092 }
◆ Operation() [1/2]
template<class TA, class TR>
| TR duckdb::NegateOperator::Operation |
( |
TA | input | ) |
|
|
inlinestatic |
228095 {
228096 if (!CanNegate<TA>(input)) {
228097 throw OutOfRangeException("Overflow in negation of numeric value!");
228098 }
228099 return -(TR)input;
228100 }
◆ CanNegate() [2/3]
template<>
| bool duckdb::NegateOperator::CanNegate |
( |
float | input | ) |
|
|
inline |
228105 {
228106 return true;
228107}
◆ CanNegate() [3/3]
template<>
| bool duckdb::NegateOperator::CanNegate |
( |
double | input | ) |
|
|
inline |
228109 {
228110 return true;
228111}
◆ Operation() [2/2]
228717 {
228718 interval_t result;
228719 result.months = NegateOperator::Operation<int32_t, int32_t>(input.months);
228720 result.days = NegateOperator::Operation<int32_t, int32_t>(input.days);
228721 result.micros = NegateOperator::Operation<int64_t, int64_t>(input.micros);
228722 return result;
228723}
The documentation for this struct was generated from the following file: