Mulplication with fractions .. stuck on this
duffling
Posts: 73
Im developing a MIDI controller for my digital mixer .. and to send one particular type of sysex requires both division and multiplication of a integer by 12.8
is there are work around i can use to both divide and multiply a value such as 76 by 12.8 ?
the value has a range of 1 to about 127 , and has to be divided by 12.8· basically
any help much app..
is there are work around i can use to both divide and multiply a value such as 76 by 12.8 ?
the value has a range of 1 to about 127 , and has to be divided by 12.8· basically
any help much app..
Comments
- Try multiplying 76 by the reciprocal of 12.8 which would be 1/12.8 : The answer is 5.9 the same as if you divided 76 by 12.8 (=5.9)
http://www.emesystems.com/BS2index.htm
·
1-get a floating point math coprocessor
2-do a lot of fiddling with numbers
its hard to tell you exactly what to do or how to code it because I'm sure mult and div 76 by 12.8 aren't the only numbers you are using.
but for example you could figure that you could mult 76 by 128(12.8*10) right that gives you 9728
now depending on what you want to do with that number thats were you really have to play are you doing a serout/shiftout?
then you would (maybe) have to send
math:
highnum=9728/10
lownum=dig0 9728
Send:
serout dpin,baud,(dec3 highnum,".",dec1 lownum)
this is kinda general but it gives you an idea of how you may have to play around with the numbers to get what you looking for.
it really all depend on the final outcome your looking for .
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I actually need to divide numbers as high as 2400 by 12.8 ........ the above example will only allow me to divide small integers..
thanks again !