private int number(StringBuilder token, int i) throws BadNumberException, BadCharacterException
	{
		if(i < expr.length )
		{
			if(isDigit(expr[i]))
			{
				token.append(expr[i]);
				return number(token, ++i);
			}
			else if (expr[i] == '.')
			{
				if(((i+1) < expr.length && isDigit(expr[i+1])))
				{
					token.append(expr[i]);
					return number(token, ++i);
				}
				else
				{
					throw new BadNumberException("Bad number at position " + i);
				}
			}
			else if(isOperator(expr[i]) || isParenthesis(expr[i]))
			{
				return i;
			}
			else
			{
				throw new BadCharacterException("Unknown character \"" + expr[i] + "\" at position " + i);
			}
		}
		else
		{
			return i;
		}
	}