Looks like you need Extra_LONGS for that.
The multiplication over flows the LONG VAR.
Try
Code:current_voltage = 49800 P = 7861 * current_voltage P = P / 4868 * 10
Looks like you need Extra_LONGS for that.
The multiplication over flows the LONG VAR.
Try
Code:current_voltage = 49800 P = 7861 * current_voltage P = P / 4868 * 10
Dave
Always wear safety glasses while programming.
Nevermind.
Last edited by ScaleRobotics; - 5th March 2010 at 06:29.
Hi, tenaja ...
I think you've been cheating ...
Dave is the best ...
LONGS are SIGNED ... ( Manual p.24 )
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Yeah, but it's still only 29 bytes. Does the "sign" take up 4 bytes?
The OP had
49800 * 78610 = 3914778000
Dave
Always wear safety glasses while programming.
Yes, but he also said it did not match the calculator output. My point was that the calculator proved it fits within the constraints of a Long.
A calculator gives
3914778000
LONGS can be
2147483647
Dave
Always wear safety glasses while programming.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks