RSS feed [root] /fundamental /weblog /java




login:

password:

title search:




 


Fri Jul 13 23:54:42 HKT 2018

Number



double aDouble = 12345678912345678912345.0;
BigDecimal dd = new BigDecimal(aDouble);
System.out.println(dd); // print: 12345678912345679593472

String aString = "12345678912345678912345.0";
BigDecimal bd = new BigDecimal(aString);
System.out.println(bd); // print: 12345678912345678912345.0

Java Hangs When Converting 2.2250738585072012e-308 - http://www.exploringbinary.com[..]when-converting-2-2250738585072012e-308/ http://bugs.openjdk.java.net/show_bug.cgi?id=100119

Compare performance between double and float - http://www.heatonresearch.com[..]-between-java%E2%80%99s-float-and-double

How to work correctly with double - http://vanillajava.blogspot.com.au[..]au/2014/07/compounding-double-error.html

Maybe handy api, Math.toIntExact(Long) - http://marxsoftware.blogspot.com[..]t-conversion-of-long-to-int-in-java.html
Check the border cases - http://vanillajava.blogspot.com.au[..]consistent-operation-widen-rules-in.html http://vanillajava.blogspot.com.au[..]ava-conversion-puzzler-not-suitable.html


(google search) (amazon search)
second
download zip of files only