|
-
Apr 1st, 2000, 12:21 PM
#1
Thread Starter
Frenzied Member
Try this and let me know what you think. You only need a simple form with 3 text boxes (Text1,Text2,Text3).
In General Declarations (or Form_Load) declare these:
Dim intE As Integer
Dim dblAnswer As Double
Dim strAnswer As String
Then in Load_Form add this little loop
strAnswer = "0.000000000000001"
dblAnswer = strAnswer
intE = 0
Do Until dblAnswer >= 1
dblAnswer = (dblAnswer * 10)
intE = intE - 1
Print "dblAnswer = "; dblAnswer; " and E is "; intE
Loop
Text1.Text = dblAnswer
Text2.Text = intE
If dblAnswer = 10 Then Text3.Text = "Really 10"
***************************************************
Okay, you run this and it works fine, right?
Well, change the strAnswer by deleting 2 zeroes.
Run the program again and now dblAnswer doesn't stop at 1,
it Keeps going to 10.
1. Why didn't it stop with 12 zeroes when it did with 14?
2. The second Textbox text shows us that the application regards the value of dblAnswer as 10, so why does the third textbox not contain the number 10?
Does anybody have the answer to this one? Or, does anybody's PC not put 10 in Textbox 2 with 12 zeroes?
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
|