math « decimal « 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 » decimal » math 

1. How to save decimal in java    stackoverflow.com

Having the following code in Java: double operation = 890 / 1440;
System.out.println(operation); Result: 0.0 What I want is to save the first 4 decimal digits of this operation (0.6180). Do you know how ...

2. How to get the numbers after the decimal point? (java)    stackoverflow.com

 double d = 4.321562;
Is there an easy way to extract the 0.321562 on it's own from d? I tried looking in the math class but no luck. If this can ...

3. Floating-Point Arithmetic = What is the worst precision/difference from Dec to Binary?    stackoverflow.com

as all know decimal fractions (like 0.1) , when stored as floating point (like double or float) will be internally represented in "binary format" (IEEE 754). And some decimal fractions can ...

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.