MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / isFloatConst

Function isFloatConst

src/ast/ast_match.cpp:39–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38 }
39 bool isFloatConst ( ExpressionPtr expr, float value ) {
40 if ( !expr->rtti_isConstant() ) return false;
41 auto ce = static_cast<ExprConst*>(expr);
42 switch ( ce->baseType ) {
43 case Type::tFloat: return cast<float>::to(ce->value) == value;
44 default: return false;
45 }
46 }
47
48 bool isIntOrUIntConst ( ExpressionPtr expr, int64_t value ) {
49 if ( !expr->rtti_isConstant() ) return false;

Callers 1

isZeroConstFunction · 0.85

Calls 1

toFunction · 0.85

Tested by

no test coverage detected