Linked Questions

39 votes
1 answer
109k views

What is the difference between Double and double?
Ashwin Shirva's user avatar
21 votes
2 answers
5k views

float ff = (float)31.15; double dd = 31.15; var frst = Math.Round(ff, 1, MidpointRounding.AwayFromZero); var drst = Math.Round(dd, 1, MidpointRounding.AwayFromZero); frst: 31.1 drst: 31.2 Can ...
Yaoqing's user avatar
  • 283
5 votes
4 answers
5k views

We are working with financial calculations. I found this post about storing money values as decimals: decimal vs double! - Which one should I use and when? So I'm storing amount as decimals. I have ...
Marcel's user avatar
  • 225
7 votes
3 answers
10k views

What's the difference between using decimal or floatin C#? I know float is used for more precise decimal numbers and decimal is used for few decimals like currency or prices but when it's used for few ...
Facundo Schiavoni's user avatar
20 votes
0 answers
67k views

I have come across a confusing pattern of the size and Max value of these data types in C#. While comparing these size using Marshal.SizeOf(), I have found following result- Float- 4 bytes, Double -...
Rohit Prakash's user avatar
6 votes
3 answers
4k views

Can some more experienced guys explain this strange error I found today? I was getting strange amounts when I was loading table data with my C# script. As it turns out the problem is a different ...
Ivan Bosmansky's user avatar
3 votes
2 answers
657 views

Consider this program float a = 0.7f; if (a < 0.7) { Console.WriteLine("Less"); } The output is Less. Why??
NAMO's user avatar
  • 273
2 votes
3 answers
1k views

I have a strange issue using double numbers in C# . NET here is my test: double my_value = 0.49; the problem is that the variable value shown is instead 0.48999999999999999 I do not need to display 0....
elnath78's user avatar
  • 137
2 votes
2 answers
4k views

Possible Duplicate: What is the difference between Decimal, Float and Double in C#? Today I'm wondering about Double in .Net. I've used it with Int32 the past days and started wondering what the ...
Tedd Hansen's user avatar
  • 12.4k
1 vote
2 answers
2k views

I really dont unterstand why, but my double array just sometimes round my variables, even though it shouldn't. The weird thing is, that it only does this sometimes, as you see in the picture. All of ...
Sascha Lüscher's user avatar
3 votes
3 answers
1k views

Possible Duplicate: What is the difference between Decimal, Float and Double in C#? Help me. I am developing a application in C# . I am trying: DateTime dtm1 = new DateTime(2012, 11, 15, 11, 3, ...
user1903252's user avatar
2 votes
1 answer
187 views

I wrote a program in c# static void Main(string[] args) { float c = 1....
iloveiniestaandowen's user avatar
0 votes
1 answer
218 views

Can someone please explain why the calculated value 180 * 2.2 will be different when stored in a decimal vs. a double; and perhaps also explain why .NET is calculating 180 * 2.2 with a decimal point ...
contactmatt's user avatar
  • 18.8k
0 votes
1 answer
267 views

I noticed that many libraries (for example, Math.net, NodaTime, TALib .NET port (library for technical analysis), StackExchange client for Redis db) use Double instead of Decimal. Why is that? I know ...
chester89's user avatar
  • 8,665
-2 votes
1 answer
116 views

I am performing arithmetic subtraction on the elements of a C# list of type double and it results in some incorrect results sometimes For example I have three elements in the listTempStrike as ...
DoIt's user avatar
  • 3,458

15 30 50 per page
1
2 3 4 5
12