Top "Double" questions

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

Checking if a double value is an integer - Swift

I need to check if a double-defined variable is convertible to Int without losing its value. This doesn't work because …

swift int double
Why converting from float to double changes the value?

I've been trying to find out the reason, but I couldn't. Can anybody help me? Look at the following example. …

java floating-point double precision ieee-754
How to properly display a price up to two decimals (cents) including trailing zeros in Java?

There is a good question on rounding decimals in Java here. But I was wondering how can I include the …

java double rounding decimal-point
How do I read input that could be an int or a double?

I'm writing a program in which I need to take input from the keyboard. I need to take a number …

java parsing integer double keyboard-input
how do I validate user input as a double in C++?

How would I check if the input is really a double? double x; while (1) { cout << '>'; …

c++ validation double cin
Swift - Remove Trailing Zeros From Double

What is the function that removes trailing zeros from doubles? var double = 3.0 var double2 = 3.10 println(func(double)) // 3 println(func(double2)) // 3.1

ios swift double trailing
Convert a string containing a number in scientific notation to a double in PHP

I need help converting a string that contains a number in scientific notation to a double. Example strings: "1.8281e-009" "2.3562e-007" "0.911348" …

php string double scientific-notation
How do I receive input from a textbox in a JFrame?

The following method extends a JFrame, but I need a swing textbox inside it to receive double values and store …

java swing double jtextcomponent documentfilter
Calculating nth root in Java using power method

I was trying to get a cubic root in java using Math.pow(n, 1.0/3) but because it divides doubles, it …

java math double decimal root
How to round up a number if it's not an integer?

I want to calculate a simple number, and if the number is not an integer I want to round it …

scala double ceil