473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Doubles and Singles

Why do the following results occur?

Immediate window:

?7.2 <= 6*1.2
False
?7.2 <= convert.ToSingle(6*1.2)
False
?7.2 <= convert.ToDouble(6*1.2)
False
?7.2 <= 7.2
True

What coding practise should be used to handle this situation correctly?
Nov 21 '05 #1
5 972
Peter,

Somewhere on 11-10 (or 10-11 depening on your culture setting) you see a
long thread in this newsgroup, involved where David, Jay B. Harlow, Jon
Skeet, csmba, Peter Huang, Alan Lehun and maybe even more, maybe you can
have a look at that, goes in my opinion far about your question.

Cor
Nov 21 '05 #2
Cor,
Which is why I say Oct 11th or Nov 10th, to avoid any ambiguity...

Just a thought
Jay

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Peter,

Somewhere on 11-10 (or 10-11 depening on your culture setting) you see a
long thread in this newsgroup, involved where David, Jay B. Harlow, Jon
Skeet, csmba, Peter Huang, Alan Lehun and maybe even more, maybe you can
have a look at that, goes in my opinion far about your question.

Cor

Nov 21 '05 #3
Jay,

I was doing that, however I became in doubt, here we say 11 october and I am
in doubt if it is every where in the English speaking world done as in the
US because in Brittain they use 11-10-2004 for October 11th 2004 and not the
US anglo Canadian way.

However I do that next time, you know I have something against that
assynchrose use of the date as done in the US.

That has nothing to do with the US is self. I have as well something agains
the crazy use of numbers in the Dutch and German language, we say
translated to English numbers OneTwenty, TwoTwenty, HundredOneTwenty, real
foolish.

Maybe you knew this however the French beat us in that FourTwentyTenOne
means 91 while the French speaking part of Belgian use NintyOne.

However I have to life with that, next time I use october 11.

Thank you for pointing your attention on that.

Cor
Cor,
Which is why I say Oct 11th or Nov 10th, to avoid any ambiguity...

Just a thought
Jay

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Peter,

Somewhere on 11-10 (or 10-11 depening on your culture setting) you see a
long thread in this newsgroup, involved where David, Jay B. Harlow, Jon
Skeet, csmba, Peter Huang, Alan Lehun and maybe even more, maybe you can
have a look at that, goes in my opinion far about your question.

Cor


Nov 21 '05 #4
Cor,
I don't think it matters if you use 10 October or October 10, my point was I
spell out the month...

By "spell out" I mean I use either the full word October, or its abbrivation
Oct.

Just a thought
Jay

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Jay,

I was doing that, however I became in doubt, here we say 11 october and I
am in doubt if it is every where in the English speaking world done as in
the US because in Brittain they use 11-10-2004 for October 11th 2004 and
not the US anglo Canadian way.

However I do that next time, you know I have something against that
assynchrose use of the date as done in the US.

That has nothing to do with the US is self. I have as well something
agains the crazy use of numbers in the Dutch and German language, we say
translated to English numbers OneTwenty, TwoTwenty, HundredOneTwenty, real
foolish.

Maybe you knew this however the French beat us in that FourTwentyTenOne
means 91 while the French speaking part of Belgian use NintyOne.

However I have to life with that, next time I use october 11.

Thank you for pointing your attention on that.

Cor
Cor,
Which is why I say Oct 11th or Nov 10th, to avoid any ambiguity...

Just a thought
Jay

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Peter,

Somewhere on 11-10 (or 10-11 depening on your culture setting) you see a
long thread in this newsgroup, involved where David, Jay B. Harlow, Jon
Skeet, csmba, Peter Huang, Alan Lehun and maybe even more, maybe you can
have a look at that, goes in my opinion far about your question.

Cor



Nov 21 '05 #5
Jay,

Clear, however I did not want to do it wrong but I got it again. In Brittain
I thought it was 10th of October. So there was not been a problem when I had
written 10 Oct.

:-))

Cor
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Daniel Lidström | last post by:
Hi, I'm currently using this method to extract doubles from a string: System::String* sp = S" "; System::String* tokens = s->Trim()->Split(sp->ToCharArray()); m_Northing =...
43
by: J.K. Becker | last post by:
Hi there, I am trying to multiply doubles with floats (actually I tried every possible combination by now) and it never works (well, it does something but it is always wrong). I have no idea...
2
by: elziko | last post by:
I have a file which, at a certain point, contains 40000 bytes. I need to go through these bytes and for each four bytes I need to create a singles ending up with 10000 singles. This is how I'm...
5
by: Tales Normando | last post by:
The title says it all. Anyone?
12
by: John Smith | last post by:
This code for the comparison of fp types is taken from the C FAQ. Any problems using it in a macro? /* compare 2 doubles for equality */ #define DBL_ISEQUAL(a,b)...
0
by: sudha madhuri | last post by:
videos-singles inside-{for date-chating mails} http://www.6URL.com/15EL India's greatest social networksite-with all features. here you watch videos (adult-romance-fun-updates) make your...
27
by: brad | last post by:
Does anyone else feel that unittesting is too much work? Not in general, just the official unittest module for small to medium sized projects? It seems easier to write some quick methods that are...
5
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I developed a custom Matrix class derived from custom VC++ doubles Array class derived from a RealArray which is defined as: typedef CArray<double,doubleRealArray; Now I need to convert...
2
by: utab | last post by:
Dear all, On a formatted printing operation that I am trying to accomplish for doubles, I have a question. I would like to print a double, d, and its square, d*d, but I would like to make the...
48
by: Bill Cunningham | last post by:
Is this valid C syntax ? double=double/int; I seem to be having trouble here. Bill
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.