Divide with decimals

phoenix70

New Member
Hi friends, I need divide a number w1 with w2 the mantisa is (9999.99) or (9999.9) or (99.999) or (999.99) the problem is that the number is too large to (16 bit) I separe in byte (9999.99) and work (b1,b2,b3,".",b4,b8) for example with (b5,b2,b6,".",b7,b9) is much more memory but work fine, but for divide or I do a average between the weigh and the number of weighs (The weigh is sending for the scale in format ASCII a 9600, please like I can dividir like decimals ? some routine ? I need your helps

 
 

moxhamj

New Member
1) You could use a floating point co-processor. <A href='http://www.rev-ed.co.uk/picaxe/software.htm' Target=_Blank>External Web Link</a> scroll down to the bottom of the page and there are some links with code examples.

2) There are ways to do long division using the byte and word variable limitations of the picaxe with an arbitrary number of decimal places. I must dig out the machine code and translate it into picaxe code - essentially it is like old fashioned long division like at school, but in binary.
 
Top