arithmetic problem in a VB module
Author Message
arithmetic problem in a VB module

I am a french student and for my final year project
I am using ms access 97 on a P 200 MMX
Nevertheless in a VB module the result of multiplication
with singles is not correct !
for exemple  :
dim a,b,c as single
a=15.55
b=8.98
c=a*b*0.83
And with the de{*filter*}, I can see c=123.353760070801 !??
If somebody can to explain this mistake, please send me a e-mail

Thanks

--

Thu, 09 Nov 2000 03:00:00 GMT
arithmetic problem in a VB module

I don't have time to check your problem, but I thought I would point out
that

dim a,b,c as single

does not declare a, b and c as single.
In your example, a and b are variants. Use:

dim a as single, b as single, c as single

Regards,
David Hager

Quote:

>I am a french student and for my final year project
>I am using ms access 97 on a P 200 MMX
>Nevertheless in a VB module the result of multiplication
>with singles is not correct !
>for exemple  :
>dim a,b,c as single
>a=15.55
>b=8.98
>c=a*b*0.83
>And with the de{*filter*}, I can see c=123.353760070801 !??
>If somebody can to explain this mistake, please send me a e-mail

>Thanks

>--

Thu, 09 Nov 2000 03:00:00 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages