Top "Double" questions

Double is a primitive data type used to store fractional numbers that holds a double-precision floating-point (often 64 bits).

When should I use double instead of decimal?

I can name three advantages to using double (or float) instead of decimal: Uses less memory. Faster because floating point …

c# types floating-point double decimal
Could not cast value of type 'NSTaggedPointerString' to 'NSNumber'

I have a Swift struct like this. struct Usage { var totalData: Double var remainingTotalData: Double init(jsonData: NSData) { var jsonDict = […

ios swift double nsjsonserialization
Truncate a float and a double in java

I want to truncate a float and a double value in java. Following are my requirements: 1. if i have 12.49688f, …

java floating-point double truncate
How to convert decimal to double in C#

I want to use a Track-Bar to change a Form's opacity. This is my code: decimal trans = trackBar1.Value / 5000; this.…

c# floating-point type-conversion double decimal
Split double into two int, one int before decimal point and one after

I need to split an double value, into two int value, one before the decimal point and one after. The …

c# double int decimal-point
How to format Double with dot?

How do I format a Double with String.format to String with a dot between the integer and decimal part? …

java string format double
Dividing two integers to a double in java

I can see this is a common problem for new programmers, however I didn't succeed in implementing any of the …

java int double divide
Round Up a double to int

I have a number ("double") from int/int (such as 10/3). What's the best way to Approximation by Excess and convert …

c# math double int approximation
Why doesn't Java throw an Exception when dividing by 0.0?

I have code to calculate the percentage difference between 2 numbers - (oldNum - newNum) / oldNum * 100; - where both of the …

java types integer double divide-by-zero
Why can't we use '==' to compare two float or double numbers

I am reading Effective java by Joshua Bloch and in Item 8: Obey the general contract when overriding equals, this statement …

java floating-point double equals