// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package april;

public class MathFun {
	public static void main(String[] args) {
		int[][] b = new int[4][256];
		double x = 123456789123456789.0;
		for(int i = 0; i < 100000; i++) {
			x *= 1.001;
			long i64 = (long)x;
			int i32 = (int)i64;
			//System.out.printf("%20d %10d\n", i64, i32);
			for(int j = 0; j < 4; j++) {
				b[j][(int)(i32 & 0x000000FF)]++;
				i32 >>= 8;
			}
		}
		for(int k = 0; k < 256; k++) {
			System.out.printf("%5d %5d %5d %5d\n", b[0][k], b[1][k], b[2][k], b[3][k]);
		}
		
	}
}
