LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Comparing double values

What is the best method for comparing double values. The following loop
produces one too many values.

Dim dblStep As Double
Dim dblT As Double
Dim dlbTMax As Double

dblStep = 0.005
dblTMax = 0.060
dblT = 0.0

While dblT < dblTMax
MsgBox Str(dblT)
dblT = dblT + dblStep
Wend

Produces:
0.000
0.005
0.010
0.015
0.020
0.025
0.030
0.035
0.040
0.045
0.050
0.055
0.060 <- This one should not have been produced.

*** Sent via Developersdex http://www.developersdex.com ***
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to double values in a cell MS Excel Worksheet Functions 9 May 13th 07 03:20 AM
Help with Comparing values and retrieving values in Excel!!!!!! [email protected] Excel Worksheet Functions 1 November 17th 06 12:21 AM
Comparing values between columns only when there are values in bot Mark K Excel Worksheet Functions 1 February 19th 06 06:47 PM
Comparing values in two columns and displaying missing values in n cpetta Excel Programming 1 April 2nd 05 06:18 AM
Comparing Values Todd Huttenstine[_2_] Excel Programming 7 December 1st 03 06:37 AM


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"