Vertica::VNumericTemp< Alloc > Class Template Reference
Inheritance diagram for Vertica::VNumericTemp< Alloc >:
Collaboration diagram for Vertica::VNumericTemp< Alloc >:
| Public Member Functions | |
|---|---|
| VNumericTemp (int32 precision, int32 scale, const Alloc &alloc=Alloc()) | |
| VNumericTemp (Typemod typmod, const Alloc &alloc=Alloc()) | |
| VNumericTemp (int32 attr, const Alloc &alloc=Alloc()) | |
| VNumericTemp (VNumericTemp &&from) | |
| void | accumulate (const VNumeric *from) |
| Adds another VNumeric to this VNumeric. | |
| void | add (const VNumeric *a, const VNumeric *b) |
| int | compare (const VNumeric *from) const |
| Compares this (signed) VNumeric to another. | |
| int | compareUnsigned (const VNumeric *from) const |
| Compares this (unsigned) VNumeric to another. | |
| bool | copy (const VNumeric *from, bool throw_error=true) |
| Copy data from another VNumeric. | |
| bool | copy (ifloat value, bool round=true) |
| Copy data from a floating-point number. | |
| void | div (const VNumeric *a, const VNumeric *b) |
| bool | equal (const VNumeric *from) const |
| Indicates whether some other VNumeric is equal to this one. | |
| int32 | getPrecision () const |
| int32 | getScale () const |
| void | incr () |
| void | invertSign () |
| Inverts the sign of this VNumeric (equivalent to multiplying this VNumeric by -1) | |
| bool | isNeg () const |
| Indicates if this VNumeric is negative. | |
| bool | isNull () const |
| Indicates if this VNumeric is the SQL NULL value. | |
| bool | isZero () const |
| Indicates if this VNumeric is zero. | |
| void | mul (const VNumeric *a, const VNumeric *b) |
| VNumericTemp & | operator*= (const VNumeric &other) |
| VNumericTemp & | operator+= (const VNumeric &other) |
| VNumericTemp & | operator-= (const VNumeric &other) |
| VNumericTemp & | operator/= (const VNumeric &other) |
| bool | operator (const VNumeric &other) const |
| bool | operator>= (const VNumeric &other) const |
| VNumericTemp & | operator>>= (unsigned shift) |
| void | setNull () |
| Sets this VNumeric to the SQL NULL value. | |
| void | setZero () |
| Sets this VNumeric to zero. | |
| void | shiftLeft (unsigned bitsToShift) |
| void | shiftRight (unsigned bitsToShift) |
| void | sub (const VNumeric *a, const VNumeric *b) |
| ifloat | toFloat () const |
| Convert the VNumeric value into floating-point. | |
| size_t | toString (char *outBuf, int olen) const |
| Static Public Member Functions | |
|---|---|
| static int32 | getCoveringTypeMod (int32 attra, int32 attrb) |
Detailed Description
template>
class Vertica::VNumericTemp
Represents an intermediate result in an arithmetic expression of VNumerics
Member Function Documentation
◆compare()
int Vertica::VNumeric::compare(const VNumeric * from) const
inline inherited Compares this (signed) VNumeric to another.
Returns -1 if this < other, 0 if equal, 1 if this > other
Note SQL NULL compares less than anything else; two SQL NULLs are considered equal
◆compareUnsigned()
int Vertica::VNumeric::compareUnsigned(const VNumeric * from) const
inline inherited Compares this (unsigned) VNumeric to another.
Returns -1 if this < other, 0 if equal, 1 if this > other
Note SQL NULL compares less than anything else; two SQL NULLs are considered equal
◆copy() [1/2]
bool Vertica::VNumeric::copy(const VNumeric * from, bool throw_error = true)
inline inherited Copy data from another VNumeric.
Parameters
from: The source VNumericthrow_error: Whether to throw an exception if the coercion fails
Returns true if the coercion succeeded, false otherwise (if throw_error is false)
◆copy() [2/2]
bool Vertica::VNumeric::copy(ifloat value, bool round = true)
inline inherited Copy data from a floating-point number.
Parameters
value: The source floating-point numberround: Truncates if false; otherwise the numeric result is rounded
Returns false if conversion failed (precision lost or overflow, etc); true otherwise
◆getCoveringTypeMod()
template<class Alloc = std::allocator<uint64>>
static int32 Vertica::VNumericTemp::getCoveringTypeMod(int32 attra, int32 attrb)
inlinestatic
Returns the typmod needed for a result of adding/subtracting numeric values with typmods a and b respectively
◆toFloat()
ifloat Vertica::VNumeric::toFloat() const
inline inherited Convert the VNumeric value into floating-point.
Returns the value in 80-bit floating-point