PDA

View Full Version : pbp math help please!!!



houa
- 5th October 2005, 04:51
for some reason i keep on getting inaccurate readings from the following equations...

M VAR BYTE
A VAR word
B VAR word
C VAR word
D VAR word
W var byte
HH var word
weight var byte
BMIA VAR BYTE
BMIB VAR BYTE
BF VAR BYTE

CALBF:
B=82/1000
A=415/100
C=9842/100
D=7676/100

IF (M=1) THEN
GOsub MALEBF
Else
GOsub FEMALEBF
goto RT
ENDIF

MALEBF:
BFA = (A*WAIST) 'waist(inches)
BFB = (B*W) 'W=weight(lbs)
BF = (-C + BFA - BFB)
BF = BF/W
BF = BF*100
return

FEMALEBF:
BFA = (A*WAIST)
BFB = (B*w)
BF = (-D + BFA - BFB)
BF = BF/w
BF = BF*100
return
RT:
BODYFAT = BF
RETURN
'
'
CALBMI:
HH=HEIGHT*HEIGHT 'example use 70 inches
BMIA=WEIGHT
BMIB=HH
BMI=WEIGHT/HH
BMI=BMI*703
RETURN

Acetronics2
- 5th October 2005, 08:46
Just read the manual : PBP works with INTEGERS !!!

Alain

picnaut
- 5th October 2005, 16:15
Hi,

PBP can't handle floating point math.
However, there are work-arounds.

Go to this link:
http://www.melabs.com/resources/fp.htm

Also, do a search of this forum.
You should get tons of information.
Floating point is a very "popular" topic.

I'm sure somebody here will be able to help you.

Cheers!

rhino
- 5th October 2005, 23:34
HERE'S (http://www.emesystems.com/BS2index.htm#math) an excellent write up on using integer math. Hope it helps.