added: to the parser: function frac() - remains fraction

git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@230 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-11-01 14:20:48 +00:00
parent cccf82797f
commit 4f1763d773
2 changed files with 11 additions and 0 deletions

View File

@@ -1390,6 +1390,15 @@ void Avg(int sindex, int amount_of_args, ValueType & result)
}
void Frac(int sindex, int amount_of_args, ValueType & result)
{
if( amount_of_args != 1 )
Error( err_improper_amount_of_arguments );
result = stack[sindex].value;
result.RemainFraction();
}
@@ -1596,6 +1605,7 @@ void CreateFunctionsTable()
InsertFunctionToTable("bxor", &Parser<ValueType>::BitXor);
InsertFunctionToTable("sum", &Parser<ValueType>::Sum);
InsertFunctionToTable("avg", &Parser<ValueType>::Avg);
InsertFunctionToTable("frac", &Parser<ValueType>::Frac);
}