Percentage problem
sas
Posts: 2
I am trying to develop an app that compares two values and takes action based on that comparison. This is an easy task with floating point but I’m not very knowledgeable on how to handle this without. ·
·
Input A will vary from 255 to 100 Input B will vary between· 60% and 98% of input A.
·
·
Using floating point math I would use the following logic
·
Get A
Get B
·
·
SELECT ·B/A
CASE > .95
GOTO ·
CASE > .90
GOTO
CASE > .80
GOTO
CASE > .70
GOTO
CASE < .71
GOTO
·
Since floating point is not available how can I accomplish this with the BS2?
·
Thanks,
·
Input A will vary from 255 to 100 Input B will vary between· 60% and 98% of input A.
·
·
Using floating point math I would use the following logic
·
Get A
Get B
·
·
SELECT ·B/A
CASE > .95
GOTO ·
CASE > .90
GOTO
CASE > .80
GOTO
CASE > .70
GOTO
CASE < .71
GOTO
·
Since floating point is not available how can I accomplish this with the BS2?
·
Thanks,
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
· testVal = bVal * 100 / aVal
· SELECT testVal
··· CASE > 95
····· ' code·here
··· CASE 91 TO 95
····· ' code·here·
··· CASE 81 TO 90
····· ' code here
··· CASE 71 TO 80
····· ' code here
··· CASE ELSE
····· ' code here
· ENDSELECT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
That was easy and should have been obvious.
Thanks again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10