Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Double variable value in excel
Hi,
I had a question about how the double variable is used in excel. When I program in C++ and I assign x = 2; where x is a double the actual value is 1.999999999 or 2.000000011 but in excel it is exactly the number you assign it. I only ask because I was copying code from excel to C++ and part of the code involved the expression if (x = 3) then ... But in C++ you could not use it because x was not always exactly equal to 3 and I ended up using "if (x2.99 and x<3.001)" WHy is there a difference? Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Double variable value in excel
See your later question.
-- David Biddulph "Jeff" wrote in message ... Hi, I had a question about how the double variable is used in excel. When I program in C++ and I assign x = 2; where x is a double the actual value is 1.999999999 or 2.000000011 but in excel it is exactly the number you assign it. I only ask because I was copying code from excel to C++ and part of the code involved the expression if (x = 3) then ... But in C++ you could not use it because x was not always exactly equal to 3 and I ended up using "if (x2.99 and x<3.001)" WHy is there a difference? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Variable Lookup/Double Lookup | Excel Worksheet Functions | |||
double axis, double problem (i hope only to me) | Charts and Charting in Excel | |||
Sum cells based on a row variable and seperate column variable | Excel Worksheet Functions | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
How to (re)set a range.value to pass -0- to a "double" variable | Excel Discussion (Misc queries) |