by murkle · 9y ago · 0 comments
Quick Java program says 1,065,353,216 / 1,065,353,217
Which one is right? Or are Java floats just "different"?
static {
float a = 0;
long count = 0;
while (a < 1) {
count++;
a = Math.nextAfter(a, 2);
}
System.out.println("count = " + count);
}Is this not just shorthand, but an actual legitimate Java program these days?
public class Main {
static {
System.out.println("Hello world");
}
public static void main(String[] args) {}
}
[0]: https://repl.it/GDZG/1