Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::IntegerLiteral Struct Reference

Static Public Member Functions

static DUCKDB_API LogicalType GetType (const LogicalType &type)
 Returns the type that this integer literal "prefers".
static DUCKDB_API bool FitsInType (const LogicalType &type, const LogicalType &target)
 Whether or not the integer literal fits into the target numeric type.

Member Function Documentation

◆ GetType()

LogicalType duckdb::IntegerLiteral::GetType ( const LogicalType & type)
static

Returns the type that this integer literal "prefers".

140898 {
140899 D_ASSERT(type.id() == LogicalTypeId::INTEGER_LITERAL);
140900 auto info = type.AuxInfo();
140901 D_ASSERT(info->type == ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO);
140902 return info->Cast<IntegerLiteralTypeInfo>().constant_value.type();
140903}
Here is the caller graph for this function:

◆ FitsInType()

bool duckdb::IntegerLiteral::FitsInType ( const LogicalType & type,
const LogicalType & target )
static

Whether or not the integer literal fits into the target numeric type.

140905 {
140906 D_ASSERT(type.id() == LogicalTypeId::INTEGER_LITERAL);
140907 // we can always cast integer literals to float and double
140908 if (target.id() == LogicalTypeId::FLOAT || target.id() == LogicalTypeId::DOUBLE) {
140909 return true;
140910 }
140911 if (!target.IsIntegral()) {
140912 return false;
140913 }
140914 // we can cast to integral types if the constant value fits within that type
140915 auto info = type.AuxInfo();
140916 D_ASSERT(info->type == ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO);
140917 auto &literal_info = info->Cast<IntegerLiteralTypeInfo>();
140918 Value copy = literal_info.constant_value;
140919 return copy.DefaultTryCastAs(target);
140920}
Here is the caller graph for this function:

The documentation for this struct was generated from the following files: