Math vb.net
Just noticed something wierd in vb.net
statement like
pc = 25, Pr = 1
PC = test * Pr / 100.0
returns .24
however 25*1/100 returns .25
How do you prevent this and what causes it !!!!!
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Suthish NairRank #92 · 22.8K reputationPosted Jan 30, 2011, 8:26 PM EST
you are passing value from variable test
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Jan 30, 2011, 9:16 PM EST
what are type and value of PC,Pr and test
?
Ray Decker7 reputationPosted Jan 31, 2011, 1:29 PM EST
dim PC, PR as decimal
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Feb 1, 2011, 4:11 AM EST
Dim pc As Decimal = 25
Dim Pr As Decimal = 1
Dim test As Decimal = pc * Pr / 100
test = 25 * 1 / 100
i checked both case and both give same result .25.....