MAMEWorld >> The Loony Bin
View all threads Index   Flat Mode Flat  

amused
MAME Fan
Reged: 04/24/08
Posts: 300
Send PM
Re: Programming/maths question....soft floats...
07/26/13 07:50 PM


As for keeping "significant digits": if you mean keeping decimal digits, you definitely should see this: http://floating-point-gui.de/

As for dividing without a division instruction: see this: http://www.math.usm.edu/lambers/mat460/fall09/lecture10.pdf

If you are working on integers, and want the result as a percentage, you don't need soft floats. You can compute (A/B) as ((100*A)/B) and have your answer as a percentage. If you want to round to the nearest percentage point, compute (A/B) as ((((200*A)/B)+1)/2) or maybe ((((200*A)/B)+1)>>1) where >> is binary right-shift.







Entire thread
Subject Posted by Posted on
* Programming/maths question....soft floats... italieAdministrator 07/26/13 02:21 PM
. * Thanks for all the suggestions.... italieAdministrator  07/27/13 12:44 AM
. * Re: Programming/maths question....soft floats... krick  07/26/13 10:55 PM
. * Re: Programming/maths question....soft floats... lharms  07/26/13 09:53 PM
. * Re: Programming/maths question....soft floats... amused  07/26/13 07:50 PM
. * Re: Programming/maths question....soft floats... italieAdministrator  07/27/13 12:50 AM
. * Re: Programming/maths question....soft floats... krick  07/27/13 04:52 AM
. * Re: Programming/maths question....soft floats... Vas Crabb  07/26/13 06:31 PM
. * Re: Programming/maths question....soft floats... GatKongModerator  07/26/13 02:56 PM
. * Re: Programming/maths question....soft floats... Gor  07/26/13 03:52 PM
. * Re: Programming/maths question....soft floats... italieAdministrator  07/26/13 04:14 PM

Extra information Permissions
Moderator:  GatKong 
0 registered and 458 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1079