About Java's accuracy
Java
/ ** About Java's accuracy ** books: Float is 7, Double's accuracy is 17 ** Excerpted from "Begin Java 2" Java entry classic ** but the following program makes me This creates a suspicion ** / public class yasa {public static void main (string arg []) {/ * test eleven results * / int m = 1; int N = 11; float o = (Float) m / n; double p = (double) m / n; system.out.println ("1/11 in float =" O "/ n" "1/11 in double =" p); / * test 11-year-old results * / int E = 12; int f = 11; float g = (float) E / F; double h = (double) E / F; system.out.println ("12/11 In float = " g " / n " " 12/11 in double = " h); / * Test one-third of the result * / int a = 1; int b = 3; float c = (float) A / B; Double D = (Double) A / B; System.out.Println ("1/3 in float =" c "/ n" "1/3 in double =" D); / * Test Three-thirds of the result * / int w = 4; int x = 3; float y = (float) W / x; double z = (double) w / x; system.out.println ("4/3 in float = " y " / n " " 4/3 in double = " z);}} / * Run results: ** 1/11 in float = 0.09090909 is 8-bit ** 1/11 in double = 0.09090909090909091 17 ** 12/11 in float = 1.0909091 is 7-bit ** 12/11 in double = 1.0909090909090908 16-bit ** 1/3 in float = 0.33333334 is 8-bit ** 1/3 in Dou BLE = 0.333333333333333 is 16 bits ** 4/3 in float = 1.3333334 is 7 bits ** 4/3 in double = 1.3333333333333333 is 16-bit ** ================== ============== ** The running result scale is different, this shows the accuracy is not based on 10-based consideration.