#
Math Archive

In this post, we will see how to calculate total surface area of Hemisphere in java. Hemisphere is exactly half of sphere. There can be many practical examples of Hemisphere. You can divide earth into …

In this post, we will see how to calculate total surface area of Cylinder in java. Formula of calculating total surface area of Cylinder is: Surface area of Cylinder = 2 *Π * r * …

In this post, we will see how to get random number between 0 to 1 in java. We have already seen random number generator in java. We can simply use Math.random() method to get random …

In this post, we will see how to round double to 2 decimal places in java. There are many ways to do it.Let’s go through few ways. Math.round(double*100.0)/100.0 DecimalFormat(“###.##”) Let’s understand each with the help …

In this tutorial. we will see if how to get square root of number in java. It is very simple to get square root of number in java. You can simply use Math’s sqrt() method …

In this post, we will see how to convert String to BigDecimal in java. It is very simple to convert String to BigDecimal in java. You can simply use BigDecimal ‘s String based constructor to do …

In this post, we will see how to convert BigDecimal to String in java. There are many ways to convert BigDecimal to String in java. Some of them are: Using toString() Using String.valueOf() toString method …

Power function in java is used to get first argument’s power to 2nd argument. For example: Let’s say you want to calculate 2 to the power 4. That will be 2*2*2*2=16 In java, you can …

In this post, we will see about Java math random example. Math’s random method provides you positive signed double value from 0.0 to 1.0. Syntax This method can be used in multithreaded environment as …

Java math floor function is used to get largest integer which is lesser than number. Syntax Example Let’s use math’s floor function in the example. When you run above program, output of the …