Division by Variable

gtslabs

Member
I am trying to divide by a variable and use the whole number as a word and the fraction as a word also. My variable ranges from 1 to 5000 only
For instantce: My equation is 5000/W0
If W0 = 2002 then I need the answer to be:
5000/2002 = 2.497502
W1 = 2
W2 = 498 (only 3 places)

W1 is the easy part. :)
I am having trouble getting W2.
Thanks
Steve
 

cpedw

Senior Member
Have a look at Jeremy's procedure for averaging large numbers of variables here <A href='http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=6778&amp;forum_id=30&amp;Topic_Title=Large%2Bnumers%2Bwithout%2Boverflow&amp;forum_title=No+new+posts+please%21+22' Target=_Blank>External Web Link</a>. It includes a routine called Word1Word2divWord3 which calculates Word1 times Word2 divided by Word3 in the format you are seeking.
I've a suspicion there is a bug in the averaging module but I haven't tracked it down yet; this routine is one bit that I can't understand but I have a lot of confidence in Jeremy's work so it's probably just me being daft.

Derek
 
Top