private static int sfloatToInt(final float value) {
		if (Float.isNaN(value)) {
			return SFLOAT_NAN;
		} else if (value > SFLOAT_MAX) {
			return SFLOAT_POSITIVE_INFINITY;
		} else if (value < SFLOAT_MIN) {
			return SFLOAT_NEGATIVE_INFINITY;
		}

		int sign = value >= 0 ? +1 : -1;
		float mantissa = Math.abs(value);
		int exponent = 0; // Note: 10**x exponent, not 2**x

		// scale up if number is too big
		while (mantissa > SFLOAT_MANTISSA_MAX) {
			mantissa /= 10.0f;
			++exponent;
			if (exponent > SFLOAT_EXPONENT_MAX) {
				// argh, should not happen
				if (sign > 0) {
					return SFLOAT_POSITIVE_INFINITY;
				} else {
					return SFLOAT_NEGATIVE_INFINITY;
				}
			}
		}

		// scale down if number is too small
		while (mantissa < 1) {
			mantissa *= 10;
			--exponent;
			if (exponent < SFLOAT_EXPONENT_MIN) {
				// argh, should not happen
				return 0;
			}
		}

		// scale down if number needs more precision
		double smantissa = Math.round(mantissa * SFLOAT_PRECISION);
		double rmantissa = Math.round(mantissa) * SFLOAT_PRECISION;
		double mdiff = Math.abs(smantissa - rmantissa);
		while (mdiff > 0.5 && exponent > SFLOAT_EXPONENT_MIN &&
				(mantissa * 10) <= SFLOAT_MANTISSA_MAX) {
			mantissa *= 10;
			--exponent;
			smantissa = Math.round(mantissa * SFLOAT_PRECISION);
			rmantissa = Math.round(mantissa) * SFLOAT_PRECISION;
			mdiff = Math.abs(smantissa - rmantissa);
		}

		int int_mantissa = Math.round(sign * mantissa);
		return ((exponent & 0xF) << 12) | (int_mantissa & 0xFFF);
	}
Converts float to SFLOAT IEEE 11073 format as UINT16, rounding up or down.
See: https://github.com/signove/antidote/blob/master/src/util/bytelib.c

@param value the value to be converted.
@return given float as UINT16 in IEEE 11073 format.
ble/src/main/java/no/nordicsemi/android/ble/data/MutableData.java