Click here to Skip to main content
15,903,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Using %windir% in File.copy Pin
Ghost_80718-Aug-09 6:44
Ghost_80718-Aug-09 6:44 
GeneralRe: Using %windir% in File.copy Pin
Ghost_80718-Aug-09 9:53
Ghost_80718-Aug-09 9:53 
QuestionAutomatically starting VB 6 application at Windows Start Up Pin
RyJaBy17-Aug-09 7:02
RyJaBy17-Aug-09 7:02 
AnswerRe: Automatically starting VB 6 application at Windows Start Up Pin
Dave Kreskowiak17-Aug-09 8:07
mveDave Kreskowiak17-Aug-09 8:07 
QuestionHow to print page with Visual Basic 2008? Pin
Mohamed_Khalil17-Aug-09 6:31
Mohamed_Khalil17-Aug-09 6:31 
AnswerRe: How to print page with Visual Basic 2008? Pin
Henry Minute17-Aug-09 7:06
Henry Minute17-Aug-09 7:06 
QuestionAdding a Positive Double to Negative Double Pin
KeithF17-Aug-09 3:43
KeithF17-Aug-09 3:43 
AnswerRe: Adding a Positive Double to Negative Double Pin
Luc Pattyn17-Aug-09 4:12
sitebuilderLuc Pattyn17-Aug-09 4:12 
For standard questions like this I have a standard answer:

The way floats/doubles are stored in binary makes it impossible to exactly represent
most values, especially the ones that seem like round numbers to humans thinking
using base ten.

So 4, 2, 1, 0.5, 3.5, 3.75 and many others are representable exactly (basically since
they all equal an integer divided by some power of 2); but 3.6 and 3.8 and an infinite
number of other values are not.

Now whatever float/double function you call, if it returns a float/double will suffer
from the same phenomenon. So the only way to really get "3.6" or "3.8" is by using a
function that not only rounds but returns a string. I trust there are some formatting
methods that do just that in every programming language; In .NET languages
ToString() should be one of them, given an appropriate format specifier.

If you want to know much more about this topic, here it is:
http://docs.sun.com/source/806-3568/ncg_goldberg.html

BTW: to circumvent the floating-point rounding problem, especially for monetary
numbers, they introduced the "decimal" data type (which basically stores decimal
digits).

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Adding a Positive Double to Negative Double Pin
KeithF17-Aug-09 4:16
KeithF17-Aug-09 4:16 
QuestionCanceling a ThreadPool thread that's being blocked by a .NET method Pin
Brandon D. Legault17-Aug-09 3:39
Brandon D. Legault17-Aug-09 3:39 
AnswerRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Dave Kreskowiak17-Aug-09 4:28
mveDave Kreskowiak17-Aug-09 4:28 
GeneralRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Brandon D. Legault17-Aug-09 4:41
Brandon D. Legault17-Aug-09 4:41 
GeneralRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Dave Kreskowiak17-Aug-09 6:54
mveDave Kreskowiak17-Aug-09 6:54 
GeneralRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Brandon D. Legault17-Aug-09 7:43
Brandon D. Legault17-Aug-09 7:43 
AnswerRe: Canceling a ThreadPool thread that's being blocked by a .NET method Pin
Luc Pattyn17-Aug-09 14:47
sitebuilderLuc Pattyn17-Aug-09 14:47 
QuestionProject Size ? Pin
Paramu197317-Aug-09 3:13
Paramu197317-Aug-09 3:13 
AnswerRe: Project Size ? Pin
Johan Hakkesteegt17-Aug-09 3:27
Johan Hakkesteegt17-Aug-09 3:27 
QuestionHelp with automated VB script? Pin
mukkil17-Aug-09 0:27
mukkil17-Aug-09 0:27 
AnswerRe: Help with automated VB script? Pin
mukkil17-Aug-09 1:22
mukkil17-Aug-09 1:22 
QuestionRotate Label to 90° Angle Pin
Anubhava Dimri16-Aug-09 23:46
Anubhava Dimri16-Aug-09 23:46 
AnswerRe: Rotate Label to 90° Angle Pin
Johan Hakkesteegt17-Aug-09 0:11
Johan Hakkesteegt17-Aug-09 0:11 
AnswerRe: Rotate Label to 90° Angle Pin
The Man from U.N.C.L.E.17-Aug-09 2:35
The Man from U.N.C.L.E.17-Aug-09 2:35 
Questionhow to find max orderno of the same customer Pin
AjitMourya16-Aug-09 21:47
AjitMourya16-Aug-09 21:47 
AnswerRe: how to find max orderno of the same customer Pin
tosch16-Aug-09 21:55
tosch16-Aug-09 21:55 
GeneralRe: how to find max orderno of the same customer Pin
AjitMourya18-Aug-09 19:04
AjitMourya18-Aug-09 19:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.