Hi guys, I am doing a little project for college and I have two word variables to multiply, and need to get another word as result (calculating P = U * I). My voltage maximum is 12 228 (mV) and current maximum is 1100 (mA) so power maximum should be 13 450 800 with last 3 digits ignored (divided by 1000) 13 450 mW which should be in bounds for word size variable.
This is my code but it seems to have ~50 mW error
let Power = Current / 10 ;Dividing current with 10
let GeneralPurp = Voltage /100 ;Dividing voltage with 100, total division 1000 = ignoring last 3 digits of power
let Power = Power * GeneralPurp ;Multiplying it
I have tried various combinations with * and ** but i have no idea how to merge those 2 words into 1
Anyone got idea how to solve this?
As you can see in this picture, (4.437 * 0.078 should be 0. 346 not 0.308) which is almost 40 mW error
This is my code but it seems to have ~50 mW error
let Power = Current / 10 ;Dividing current with 10
let GeneralPurp = Voltage /100 ;Dividing voltage with 100, total division 1000 = ignoring last 3 digits of power
let Power = Power * GeneralPurp ;Multiplying it
I have tried various combinations with * and ** but i have no idea how to merge those 2 words into 1
Anyone got idea how to solve this?
As you can see in this picture, (4.437 * 0.078 should be 0. 346 not 0.308) which is almost 40 mW error