[A83] A call to those who think they know more than me.


[Prev][Next][Index][Thread]

[A83] A call to those who think they know more than me.




//TODO: could be more efficient
_inline fixedpoint_t fpm_Ceil(fixedpoint_t fxp) {
	if (fxp&0x0000ffff) {
		if (fxp<=0) return -(fixedpoint_t)((-fxp)&0xffff0000);
		return (fxp&0xffff0000)+FPM_FROMLONGC(1);
	}
	return fxp;
}
//TODO: could be more efficient
_inline fixedpoint_t fpm_Floor(fixedpoint_t fxp) {
	if (fxp&0x0000ffff) {
		if (fxp<0) return -(long)(((-fxp)&0xffff0000)+FPM_FROMLONGC(1));
		return fxp&0xffff0000;
	}
	return fxp;
}

Can you make these more efficient?



Follow-Ups: References: