encoder.js
function isNumericSubclass( t, t_min, t_max, of_t ) {
	if ((t === NUMTYPE.NAN) || (of_t === NUMTYPE.NAN)) return false;
	switch (of_t) { // Parent
		case NUMTYPE.UINT8:
			switch (t) {
				case NUMTYPE.UINT8:
					return true;
				case NUMTYPE.INT8:
					return (t_min > 0);
				default:
					return false;
			}

		case NUMTYPE.INT8:
			switch (t) {
				case NUMTYPE.UINT8:
					return (t_max < INT8_MAX);
				case NUMTYPE.INT8:
					return true;
				default:
					return false;
			}

		case NUMTYPE.UINT16:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.UINT16:
					return true;
				case NUMTYPE.INT8:
				case NUMTYPE.INT16:
					return (t_min > 0);
				default:
					return false;
			}

		case NUMTYPE.INT16:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.INT8:
				case NUMTYPE.INT16:
					return true;
				case NUMTYPE.UINT16:
					return (t_max < INT16_MAX);
				default:
					return false;
			}

		case NUMTYPE.UINT32:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.UINT16:
				case NUMTYPE.UINT32:
					return true;
				case NUMTYPE.INT8:
				case NUMTYPE.INT16:
				case NUMTYPE.INT32:
					return (t_min > 0);
				default:
					return false;
			}

		case NUMTYPE.INT32:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.INT8:
				case NUMTYPE.UINT16:
				case NUMTYPE.INT16:
				case NUMTYPE.INT32:
					return true;
				case NUMTYPE.UINT32:
					return (t_max < INT32_MAX);
				default:
					return false;
			}

		case NUMTYPE.FLOAT32:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.INT8:
				case NUMTYPE.UINT16:
				case NUMTYPE.INT16:
				case NUMTYPE.FLOAT32:
					return true;
				case NUMTYPE.UINT32:
				case NUMTYPE.INT32:
					return (t_min > FLOAT32_NEG) && (t_max < FLOAT32_POS);
				default:
					return false;
			}

		case NUMTYPE.FLOAT64:
			return true;

	}
	return false;
}
function isNumericSubclass( t, t_min, t_max, of_t ) {
	if ((t === NUMTYPE.NAN) || (of_t === NUMTYPE.NAN)) return false;
	switch (of_t) { // Parent
		case NUMTYPE.UINT8:
			switch (t) {
				case NUMTYPE.UINT8:
					return true;
				case NUMTYPE.INT8:
					return (t_min > 0);
				default:
					return false;
			}

		case NUMTYPE.INT8:
			switch (t) {
				case NUMTYPE.UINT8:
					return (t_max < INT8_MAX);
				case NUMTYPE.INT8:
					return true;
				default:
					return false;
			}

		case NUMTYPE.UINT16:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.UINT16:
					return true;
				case NUMTYPE.INT8:
				case NUMTYPE.INT16:
					return (t_min > 0);
				default:
					return false;
			}

		case NUMTYPE.INT16:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.INT8:
				case NUMTYPE.INT16:
					return true;
				case NUMTYPE.UINT16:
					return (t_max < INT16_MAX);
				default:
					return false;
			}

		case NUMTYPE.UINT32:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.UINT16:
				case NUMTYPE.UINT32:
					return true;
				case NUMTYPE.INT8:
				case NUMTYPE.INT16:
				case NUMTYPE.INT32:
					return (t_min > 0);
				default:
					return false;
			}

		case NUMTYPE.INT32:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.INT8:
				case NUMTYPE.UINT16:
				case NUMTYPE.INT16:
				case NUMTYPE.INT32:
					return true;
				case NUMTYPE.UINT32:
					return (t_max < INT32_MAX);
				default:
					return false;
			}

		case NUMTYPE.FLOAT32:
			switch (t) {
				case NUMTYPE.UINT8:
				case NUMTYPE.INT8:
				case NUMTYPE.UINT16:
				case NUMTYPE.INT16:
				case NUMTYPE.FLOAT32:
					return true;
				case NUMTYPE.UINT32:
				case NUMTYPE.INT32:
					return (t_min > FLOAT32_NEG) && (t_max < FLOAT32_POS);
				default:
					return false;
			}

		case NUMTYPE.FLOAT64:
			return true;

	}
	return false;
}
function isNumericSubclass ( t , t_min , t_max , of_t ) { if ( ( t === NUMTYPE . NAN ) || ( of_t === NUMTYPE . NAN ) ) return false ; switch ( of_t ) { // Parent case NUMTYPE . UINT8 : switch ( t ) { case NUMTYPE . UINT8 : return true ; case NUMTYPE . INT8 : return ( t_min > 0 ) ; default : return false ; } case NUMTYPE . INT8 : switch ( t ) { case NUMTYPE . UINT8 : return ( t_max < INT8_MAX ) ; case NUMTYPE . INT8 : return true ; default : return false ; } case NUMTYPE . UINT16 : switch ( t ) { case NUMTYPE . UINT8 : case NUMTYPE . UINT16 : return true ; case NUMTYPE . INT8 : case NUMTYPE . INT16 : return ( t_min > 0 ) ; default : return false ; } case NUMTYPE . INT16 : switch ( t ) { case NUMTYPE . UINT8 : case NUMTYPE . INT8 : case NUMTYPE . INT16 : return true ; case NUMTYPE . UINT16 : return ( t_max < INT16_MAX ) ; default : return false ; } case NUMTYPE . UINT32 : switch ( t ) { case NUMTYPE . UINT8 : case NUMTYPE . UINT16 : case NUMTYPE . UINT32 : return true ; case NUMTYPE . INT8 : case NUMTYPE . INT16 : case NUMTYPE . INT32 : return ( t_min > 0 ) ; default : return false ; } case NUMTYPE . INT32 : switch ( t ) { case NUMTYPE . UINT8 : case NUMTYPE . INT8 : case NUMTYPE . UINT16 : case NUMTYPE . INT16 : case NUMTYPE . INT32 : return true ; case NUMTYPE . UINT32 : return ( t_max < INT32_MAX ) ; default : return false ; } case NUMTYPE . FLOAT32 : switch ( t ) { case NUMTYPE . UINT8 : case NUMTYPE . INT8 : case NUMTYPE . UINT16 : case NUMTYPE . INT16 : case NUMTYPE . FLOAT32 : return true ; case NUMTYPE . UINT32 : case NUMTYPE . INT32 : return ( t_min > FLOAT32_NEG ) && ( t_max < FLOAT32_POS ) ; default : return false ; } case NUMTYPE . FLOAT64 : return true ; } return false ; }
Check if the specified number is a subclass of an other
Check if the specified number is a subclass of an other