473,657 Members | 2,626 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to compare two double datatype values in C#

1 New Member
I am not able to compare two double values in c#

Ex:

double x=36.2444
double Y=35.2244
if(X < Y)
Console.writeli ne(the value of X:",X);
Jun 23 '15 #1
1 1795
computerfox
276 Contributor
I believe the x is lowercase. Can you try again and let us know?
Also, when you're printing the content, I believe it should be:
Expand|Select|Wrap|Line Numbers
  1. Console.writeline("The value of X: "+x);
  2.  
Jun 24 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
8583
by: akoper | last post by:
I have a table that is a project. Each record is a task in the project. One field in each record is a date/time stamp for when that task was completed. I need to be able to: 1) compute how much time has passed between each date/time stamp and 2) compute how much time has passed between the first and last date/time stamp (total project time). This involves a self join, and I have nearly gotten it to work, but I need a little more help. ...
0
4077
by: dotyet | last post by:
Hey All, I have a small problem. consider the following >db2 "create table ttt (mynum float, yournum double )" DB20000I The SQL command completed successfully. >db2 "describe table ttt" Column Type Type
1
4271
by: L Mehl | last post by:
Hello -- Goal is to export data from tblData having this structure: dateRecord Date/Time textFrom Text 4 textTo Text 4 valueRecord Number Double (format = Standard, Dec Pl = 12) Using the following code
0
1547
by: Kaja | last post by:
Hi, Compare validator throws error if I have thousand seperator in the double value. ControlToValidate: TextBox1 Operator: DataTypeCheck Type: Double Any help appreciated.
6
1749
by: mdburton | last post by:
$row = mysql_fetch_array(mysql_query("SELECT enemies FROM $tab WHERE id='$cid'")); $array = explode (",", $row); $crewupdate = mysql_query("SELECT id,name,founder FROM $tab WHERE id>0 AND id!=$array ORDER BY name ASC;"); This doesn't yeild anyresults since you cant use '' in query, however i have tried just the name but that doesnt work, when i try it only uses the first array space to compare not the others
26
7130
by: neha_chhatre | last post by:
can anybody tell me how to compare two float values say for example t and check are two variables declared float how to compare t and check please help me as soon as possible
1
2417
by: SEhtesham | last post by:
Hi, My application is in VS2008 coded in vb.net.I have a table with three columns FromDate,Todate and Schedule.FromDate and ToDate will have date values whereas Schedule will have a any of these values(weekly,Monthly,Yearly) In my Form i have given some provision to the user to check the records.My requirement is The currentdate that is Today's date should be compared with the values of Fromdate and ToDate.First it should be check...
5
2739
by: sophannaly | last post by:
Hi, I have one issue that I don't understand. In my table I have fields like total, jan, feb, mar, apr, may,...,dec and all these fields I set its datatype as double and precision as auto. In my form, I have use before update action to each input text box with condition as : if(nz(me.jan,0)+nz(me.feb,0)+nz(me.mar,0)+nz(me.apr,0)+nz(me.may,0)+nz(me.jun,0)+nz(me.jul,0)+nz(me.aug,0)+nz(me.sep,0)+nz(me.oct,0)+nz(me.nov,0)+nz(me.dec,0))...
1
1249
by: Praveen07 | last post by:
Hi, I have come across a strange scenario while executing a query. I was surprised by the way Sql Server was executing the query. Quote: SELECT TOP 10 MR.MerchantContactFirstName + ' ' + MR.MerchantContactLastName AS MerchantName, AISLTrans.DeviceID,AISLTrans.TransactionID, AISLTrans.CardNumber, AISLTrans.TransactionDateTime, AISLTrans.TransactionStatus, AISTRNSTYPE.TransactionType AS...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.