// // Supporting material for lecture 3 // - numbers // import FormatIO.*; public class Demo03b { public static void main(String[] args){ Console con = new Console(); /* int a = con.readInt(); int b = con.readInt(); con.println(a + " " + b + " " + a / b + " " + a % b); */ double x = 7; float y = 3; double dPi = Math.PI; //float fPi = Math.PI; long m = 332189734; con.println("7/3 = " + x/y); con.println("Math.PI = " + dPi); con.println("long m = " + m); con.println("Math.log(m) = " + Math.log(m)); con.println("Math.log(m)to base 10 = " + Math.log(m)/Math.log(10)); con.println("3+4*5+6 = " + (3 + 4 * 5 + 6)); // need brackets!! } } // // give it a whirl with negative numbers // And pay respect to Euclid! // // int, long, float, double // Math package // // NOTE: naming conventions // // - of Classes // - of instances // - of integers, reals, strings // - ofMethodsThatWeAreIntersetedIn // - anythigelse (consistent errors :) //