-
June 28th, 2005, 07:28 AM
#1
Result of division
Code:
Dim q1 As Double
Dim q2 As Double
Dim res As Double
q1 = 17.59
q2 = 1300
res = q1 / q2
MsgBox res
Result = 1,35307692307692E-02
With Windows calculator
17.59 / 1300 = 0.0135307692 ......
Someone know why?
Sorry for my english language!
-------------------------------
mrhyde.altervista.org
Free resource
------------------------------
-
June 28th, 2005, 08:18 AM
#2
Re: Result of division
I add another info.
The strange thing is that if we build a dll ActiveX that receive q1 and q2 value and make the result, if the application caller is a VB application the result is 1,25307.....
Instead, if tha application caller is VC++, the result is right and it is 0.01353....
For me it's incredible...
Someone know why?!?!?
Sorry for my english language!
-------------------------------
mrhyde.altervista.org
Free resource
------------------------------
-
June 28th, 2005, 08:25 AM
#3
Re: Result of division
Originally Posted by E.Hyde
Result = 1,35307692307692E-02
With Windows calculator
17.59 / 1300 = 0.0135307692 ......
Someone know why?
1.35307692307692E-02 is the same as 0.0135307692307692
The E-02 is scientific notation. The number after the E tells how many places to move the decimal and which direction to move it in. In this case, the negative means to move it left and the 2 means to move it 2 places (which gives you 0.0135307692307692).
I'd rather be wakeboarding...
-
June 28th, 2005, 08:30 AM
#4
Re: Result of division
Both are same sir
use this
Dim q1 As Double
Dim q2 As Double
Dim res As Double
Dim resf As Double
q1 = 17.59
q2 = 1300
res = q1 / q2
resf = Format(res, "##,##0.000000000")
MsgBox resf
you have to change the format
-
June 28th, 2005, 08:34 AM
#5
Re: Result of division
I'm ashamed of this.
Thanks a lot, sorry, but i'm a champion in math!!
Sorry for my english language!
-------------------------------
mrhyde.altervista.org
Free resource
------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|