# Math Archive

## calculate total surface area of Hemisphere in java

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 …

## Calculate total surface area of Cylinder in java

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 * …

## Get random number between 0 and 1 in java

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 …

## java round double/float to 2 decimal places

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 …

## How to get square root of number in java

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 …

## Java String to BigDecimal

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 …

## Java BigDecimal to String

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

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 …

## Java Math random example

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 example

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 …