Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
❮ Math Methods ExampleGet your own Java Server Get the lowest value from different pairs of numbers: System.out.println(Math.min(2.0,0.25));System.out.println(Math.min(31.2f,18.0f));System.out.println(Math.min(14,22));System.out.println(Math.min(96L,2048L)); ...
❮ Math Methods ExampleGet your own Java ServerReturn the arc sine of different numbers:System.out.println(Math.asin(0.64)); System.out.println(Math.asin(-0.4)); System.out.println(Math.asin(0)); System.out.println(Math.asin(1)); System.out.println(Math.asin(-1)); System.out....
❮ Math Methods ExampleGet your own Java ServerRound numbers up to the nearest integer:System.out.println(Math.ceil(0.60)); System.out.println(Math.ceil(0.40)); System.out.println(Math.ceil(5)); System.out.println(Math.ceil(5.1)); System.out.println(Math.ceil(-5.1)); System.out....
❮ Math Methods ExampleGet your own Java ServerAdd integers:System.out.println(Math.addExact(12, 16)); System.out.println(Math.addExact(10000, 24060)); Try it Yourself » Definition and UsageThe addExact() method adds two integers and throws an exception if the addition causes an overflow...
❮ Math Methods ExampleGet your own Java ServerReturn the cosine of different angles:System.out.println(Math.cos(3)); System.out.println(Math.cos(-3)); System.out.println(Math.cos(0)); System.out.println(Math.cos(Math.PI)); System.out.println(Math.cos(Math.PI/2)); ...
❮ Math Methods ExampleGet your own Java Server Return the absolute (positive) value of different numbers: System.out.println(Math.abs(-4.7));System.out.println(Math.abs(4.7));System.out.println(Math.abs(3)); Try it Yourself » ...
ExampleGet your own Java Server Find the next floating point number above different numbers: System.out.println(Math.nextUp(1.0f)); System.out.println(Math.nextUp(1.0)); System.out.println(Math.nextUp(0.5f)); System.out.println(Math.nextUp(0.5)); System.out.println(Math.nextUp(Math.PI...
ExampleGet your own Java Server Convert radians to degrees for different angles: System.out.println(Math.toDegrees(1)); System.out.println(Math.toDegrees(Math.PI)); System.out.println(Math.toDegrees(Math.PI / 4)); System.out.println(Math.toDegrees(-0.5236)); System.out.println(Math....
ExampleGet your own Java Server Return the hyperbolic cosine of different numbers: System.out.println(Math.cosh(3)); System.out.println(Math.cosh(-3)); System.out.println(Math.cosh(0)); System.out.println(Math.cosh(1)); Try it Yourself »...