Index: src/main/java/org/apache/hama/examples/PiEstimator.java =================================================================== --- src/main/java/org/apache/hama/examples/PiEstimator.java (revision 1596141) +++ src/main/java/org/apache/hama/examples/PiEstimator.java (working copy) @@ -59,7 +59,7 @@ int in = 0; for (int i = 0; i < iterations; i++) { double x = 2.0 * Math.random() - 1.0, y = 2.0 * Math.random() - 1.0; - if ((Math.sqrt(x * x + y * y) < 1.0)) { + if (x * x + y * y <= 1) { in++; } } @@ -119,7 +119,7 @@ BSPJob bsp = new BSPJob(conf, PiEstimator.class); bsp.setCompressionCodec(SnappyCompressor.class); bsp.setCompressionThreshold(40); - + // Set the job name bsp.setJobName("Pi Estimation Example"); bsp.setBspClass(MyEstimator.class);