Shop OBEX P1 Docs P2 Docs Learn Events
Some problem about this command */(Multiply Middle) ! — Parallax Forums

Some problem about this command */(Multiply Middle) !

BiBiBiBi Posts: 1
edited 2010-07-13 10:36 in BASIC Stamp
Help! Help!
I have a problem about this command */(Multiply Middle).
I don't know how to use.
Could you explain this command and give me more examples.
Thanks for your help!·

Comments

  • IroneIrone Posts: 116
    edited 2010-07-13 10:36
    How Ya Doin'? This is a way of multiplying with fractions or decimals with a program that only considers whole numbers. If you have read the help file on the basic stamp editor (and I hope you did) all you have to do is multiply your fraction or decimal by 256 and turn it into a hexadecimal number (if you have windows your calculator can do this for you). Lets say you have 50 and want to multiply it by 3 1/4. You forget about the 3 for now and multiply 1/4 by 256. 1/4 = .25 and if you multiply it by 256 you get 64. If you are using the windows calculator you go and hit Hex and it says 40. Then you put the 3 in front and use the dollar sign and wind up with $0340. If you do this your debug will tell you the answer is 162. The real answer is 162.5 but that is not a whole number so it only gives you 162. It is not accurate but is better than not using the 1/4 at all.

    Casey



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I fish, therefore I lie!
Sign In or Register to comment.