double BigNumber::Double() const { LispString str; ANumber num(*iNumber); ANumberToString(str, num, 10); std::istringstream is(str.c_str()); double d; is >> d; return d; }
LispInt InternalAsciiToInt(const LispString& aString) { const LispChar* ptr = aString.c_str(); if (!IsNumber(ptr, false)) throw LispErrInvalidArg(); return std::stoi(aString); }
void PrintExpression(LispString& aResult, LispPtr& aExpression, LispEnvironment& aEnvironment, std::size_t aMaxChars) { std::ostringstream stream; InfixPrinter infixprinter(aEnvironment.PreFix(), aEnvironment.InFix(), aEnvironment.PostFix(), aEnvironment.Bodied()); infixprinter.Print(aExpression, stream, aEnvironment); aResult.assign(stream.str()); if (aMaxChars > 0 && aResult.size()>aMaxChars) { aResult.resize(aMaxChars - 3); aResult += "..."; } }