accuracy « float « Java Data Type Q&A

Home
Java Data Type Q&A
1.bigdecimal
2.biginteger
3.bit
4.Boolean
5.byte
6.Calendar
7.cast
8.character
9.Date Time
10.Date Time Format
11.decimal
12.Development
13.double
14.enum
15.float
16.hexadecimal
17.Integer
18.Number
19.Number Format
20.primitive
21.SimpleDateFormat
22.string
23.StringBuffer
24.StringBuilder
25.StringTokenizer
26.substring
27.TimeZone
Java Data Type Q&A » float » accuracy 

1. double (float) accuracy    coderanch.com

Hi, I have a bit of problem with the double accuracy. E.g double os = 0.05; os += 0.05; os += 0.05; System.out.println(os); And I get 0.150000000002 (or something) I aleardy tried this program with various jdk versions and platforms and still get the same result. Of course the accuracy of the computation is not affected, but it is a small ...

2. Floating point accuracy    coderanch.com

3. floating point and double accuracy    coderanch.com

4. Help Floating Point Accuracy    go4expert.com

hi, im new to java and was wondering if anyone can help me. im my lab im suppose to do this: So we have: + 1.875 x 22 = 7.5f, which is a floating point number that can be represented exactly in Java. Assume that 12.36f is represented as 01000001010001011100001010001111. This bit pattern is not exactly 12.36, but it is very ...

5. Factorial Problem: Floating point accuracy    forums.oracle.com

A double is 64 bits, in IEEE 754 format, which translates to about 15 digits of decimal precision. So, for example, the number 9332621544394415268169923885626670049071596826438162146859296389521759999322991560894146397615651828625369792082722375825118521091686400000000000000000000000 cannot be stored in a double. [SOME THINGS YOU SHOULD KNOW ABOUT FLOATING-POINT ARITHMETIC|http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2|No, it's not a bug in Java. C/C++ does the same thing, and it's not a bug there either.] [What Every Computer Scientist Should ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.