next = (AtomicValue) iter.nextItem(); if (!Type.subTypeOf(next.getType(), Type.NUMBER)) next = next.convertTo(Type.DOUBLE); if(((NumericValue)next).isNaN())
nextItem = iter.nextItem(); nextValue = nextItem.atomize(); if (!Type.subTypeOf(nextValue.getType(), Type.NUMBER)) nextValue = nextValue.convertTo(Type.DOUBLE); if(((NumericValue)nextValue).isNaN())
	public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {		Sequence inner = getArgument(0).eval(contextSequence, contextItem);		Sequence zero = IntegerValue.ZERO;		if(getSignature().getArgumentCount() == 2)			zero = getArgument(1).eval(contextSequence, contextItem);				if (inner.getLength() == 0)			return zero;		SequenceIterator iter = inner.iterate();		AtomicValue next = (AtomicValue) iter.nextItem();		if (!Type.subTypeOf(next.getType(), Type.NUMBER))			next = next.convertTo(Type.DOUBLE);		ComputableValue sum = (ComputableValue) next;		while (iter.hasNext()) {			next = (AtomicValue) iter.nextItem();			if (!Type.subTypeOf(next.getType(), Type.NUMBER))				next = next.convertTo(Type.DOUBLE);			if(((NumericValue)next).isNaN())				return DoubleValue.NaN;			sum = sum.plus((NumericValue) next);		}		return sum;	}