if (neg) f = -f;
	public float parseFloat(int index) throws NavException {		currentOffset = getTokenOffset(index);		int end = currentOffset + getTokenLength(index);		//past the last one by one		int ch = getCharResolved();		while (currentOffset <= end) { // trim leading whitespaces			if (!isWS(ch))				break;			ch = getCharResolved();		}		if (currentOffset > end) // all whitespace			throw new NavException("Empty string");		boolean neg = (ch == '-');		if (ch == '-' || ch == '+')			ch = getCharResolved(); //get another one if it is sign.		//left part of decimal		long left = 0;		while (currentOffset <= end) {			//must be <= since we get the next one at last.			int dig = Character.digit((char) ch, 10); //only consider decimal			if (dig < 0)				break;			left = left * 10 + dig;			ch = getCharResolved();		}		//right part of decimal		long right = 0;		long scale = 1;		if (ch == '.') {			ch = getCharResolved();			while (currentOffset <= end) {				//must be <= since we get the next one at last.				int dig = Character.digit((char) ch, 10);				//only consider decimal				if (dig < 0)					break;				right = right * 10 + dig;				scale *= 10;				ch = getCharResolved();			}		}		//exponent		long exp = 0;		if (ch == 'E' || ch == 'e') {			ch = getCharResolved();			boolean expneg = (ch == '-'); //sign for exp			if (ch == '+' || ch == '-')				ch = getCharResolved(); //skip the +/- sign			int cur = currentOffset;			//remember the indx, used to find a invalid number like 1.23E			while (currentOffset <= end) {				//must be <= since we get the next one at last.				int dig = Character.digit((char) ch, 10);				//only consider decimal				if (dig < 0)					break;				exp = exp * 10 + dig;				ch = getCharResolved();			}			if (cur == currentOffset)				throw new NavException(toString(index));			//found a invalid number like 1.23E			if (expneg)				exp = (-exp);		}		//anything left must be space		while (currentOffset <= end) {			if (!isWS(ch))				throw new NavException(toString(index));			ch = getCharResolved();		}		double v = (double) left;		if (right != 0)			v += ((double) right) / (double) scale;		if (exp != 0)			v = v * Math.pow(10, exp);		if (neg)			v = -v;		float f = (float) v;		//try to handle overflow/underflow		if (v >= Float.MAX_VALUE)			f = Float.MAX_VALUE;		else if (v <= Float.MIN_VALUE)			f = Float.MIN_VALUE;		return f;	}