artrag Posted August 10, 2018 Share Posted August 10, 2018 Apart the bug spotted elsewhere that leads this kind of expressions #ex(0) = -1.0+.#ex(0) to fail, it seems that it is missing a proper support to multiplications/divisions. I was trying to multiply a fixed point number by a constant, but due to the fact that the fractional part in in the high byte, normal multiplication fails... Is there a dedicated multiplication for 8.8 fixed point numbers ? BTW what is the reason for this inversion (high/low byte)? Am I missing something or the support for fixed point numbers is just immature in v1.2.9 ? Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted August 10, 2018 Share Posted August 10, 2018 Apart the bug spotted elsewhere that leads this kind of expressions #ex(0) = -1.0+.#ex(0) to fail, it seems that it is missing a proper support to multiplications/divisions. I was trying to multiply a fixed point number by a constant, but due to the fact that the fractional part in in the high byte, normal multiplication fails... Is there a dedicated multiplication for 8.8 fixed point numbers ? BTW what is the reason for this inversion (high/low byte)? Am I missing something or the support for fixed point numbers is just immature in v1.2.9 ? Perhaps the multiplication by constant uses the macro Joe Z. and I worked on which assumed 16-bit integers. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted August 10, 2018 Share Posted August 10, 2018 I'm afraid I forgot completely about the fixed point number support in IntyBASIC. Supposedly it would have helped to integrate fractions to ease writing of Asteroids-like game but the support come with far too many bugs because it was too early. Quote Link to comment Share on other sites More sharing options...
artrag Posted August 10, 2018 Author Share Posted August 10, 2018 (edited) Well, once you fix addition and subtraction by constants, product of two 8.8 numbers is just a 32 bit multiplication where you keep the upper 16 bits as result. You need +. -. *. /. But, why the up/down bytes inversion? Does it help somehow? Edited August 10, 2018 by artrag Quote Link to comment Share on other sites More sharing options...
artrag Posted August 10, 2018 Author Share Posted August 10, 2018 Actually if you keep the same convention used for usual integers you should end up with this +. = + -. = - /. = / *. = * on 32 bits >>16 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.