MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / TokenToDouble

Function TokenToDouble

source/script2.cpp:16951–16964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16949
16950
16951double TokenToDouble(ExprTokenType &aToken, BOOL aCheckForHex)
16952// Caller has ensured that any SYM_VAR's Type() is VAR_NORMAL.
16953// Converts the contents of aToken to a double.
16954{
16955 switch (aToken.symbol)
16956 {
16957 case SYM_FLOAT: return aToken.value_double;
16958 case SYM_INTEGER: return (double)aToken.value_int64;
16959 case SYM_VAR: return aToken.var->ToDouble();
16960 case SYM_STRING: return aCheckForHex ? ATOF(aToken.marker) : _tstof(aToken.marker); // atof() omits the check for hexadecimal.
16961 }
16962 // Since above didn't return, it can only be SYM_OBJECT or not an operand.
16963 return 0;
16964}
16965
16966
16967

Callers 4

ExpandExpressionMethod · 0.85
EvaluateSwitchCaseMethod · 0.85
BIF_DECLFunction · 0.85
NumReadWriteMethod · 0.85

Calls 2

ATOFFunction · 0.85
ToDoubleMethod · 0.80

Tested by

no test coverage detected