About 150,000 results
Open links in new tab
  1. Float and double datatype in Java - Stack Overflow

    Dec 22, 2014 · double is represented in 64 bits, with 1 sign bit, 11 bits of exponent, and 52 bits of significand. By default, Java uses double to represent its floating-point numerals (so a literal 3.14 is …

  2. types - Java: double vs float - Stack Overflow

    Sep 29, 2014 · By default, Java will treat a decimal (e.g. " 4.3 ") as a double unless you otherwise specify a float by adding an f after the number (e.g. " 4.3f "). You're having the same problem on both …

  3. What is the inclusive range of float and double in Java?

    Nov 5, 2013 · double: The double data type is a double-precision 64-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in section 4.2.3 of the Java …

  4. How many significant digits do floats and doubles have in java?

    Oct 9, 2019 · 17 From java specification : The floating-point types are float and double, which are conceptually associated with the single-precision 32-bit and double-precision 64-bit format IEEE 754 …

  5. Java:Why should we use BigDecimal instead of Double in the real world ...

    Apr 16, 2016 · This article illustrates, through a series of practical examples, the main traps of using Java's simple types double and float. Note, however, that to fully embrace precision in numerical …

  6. In what situations is it better to use a float over a double in Java?

    Dec 6, 2015 · More specifically, how extreme is the performance gain when using a float instead of a double in Java?

  7. java - Float vs Double - Stack Overflow

    Feb 21, 2016 · float (0.1) and double (0.1) are different values (0.100000001490116119384765625 and 0.1000000000000000055511151231257827021181583404541015625) respectively. In your case, …

  8. типы данных - В чем разница между float и double в Java? - Stack ...

    Jul 19, 2017 · Насколько я помню, float и double различаются диапазонами, что ведёт к разной точности и скорости вычислений. Однако сегодня заметил, что с разными числами округление …

  9. java - Double vs. BigDecimal? - Stack Overflow

    Aug 5, 2010 · I have to calculate some floating point variables and my colleague suggest me to use BigDecimal instead of double since it will be more precise. But I want to know what it is and how to …

  10. floating point precision - float vs double (in Java) - Stack Overflow

    Jan 22, 2013 · A double just gives you more bits of precision beyond the decimal place than the float. If all those those extra bits are zero then you have the same value as the float.