Simple math -- second try
Archiver
Posts: 46,084
Disregard first program look at this one sorry "'" in wrong place..
Leroy
I am working on the following program:
'{$STAMP BS2}
a var byte
b var byte
x var byte
a=23
b=95
x=b/a
'x=x*100
debug "result: ", dec x
After running my debug result is "4" which looks OK.
If I change the program to:
'{$STAMP BS2}
a var byte
b var byte
x var byte
a=23
b=95
x=b/a
x=x*100
debug "result: ", dec x
My debug result is "144" ?
Why is this? I wanted to get "413".
thanks for your help,
Leroy
Leroy
I am working on the following program:
'{$STAMP BS2}
a var byte
b var byte
x var byte
a=23
b=95
x=b/a
'x=x*100
debug "result: ", dec x
After running my debug result is "4" which looks OK.
If I change the program to:
'{$STAMP BS2}
a var byte
b var byte
x var byte
a=23
b=95
x=b/a
x=x*100
debug "result: ", dec x
My debug result is "144" ?
Why is this? I wanted to get "413".
thanks for your help,
Leroy