| 16949 | |
| 16950 | |
| 16951 | double 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 |
no test coverage detected