The Artima Developer Community
Sponsored Link

Java Buzz Forum
Power function in java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Arpit Mandliya

Posts: 190
Nickname: mandliya23
Registered: May, 2017

Arpit Mandliya is Java programmer working on Core java, Spring, Hibernate
Power function in java Posted: Sep 6, 2017 12:17 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Arpit Mandliya.
Original Post: Power function in java
Feed Title: Java tutorial for beginners
Feed URL:
Feed Description: A blog about java programming language and its frameworks
Latest Java Buzz Posts
Latest Java Buzz Posts by Arpit Mandliya
Latest Posts From Java tutorial for beginners


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 do it by : Math.pow(2,4) =16 Syntax Example : Let’s use power function in java. When you run above program, you will get below output: Math.pow(2 ,4)=16.0 Math.pow(4.2,3)=74.08800000000001 If you want to return integer from power function, you need to explicitly cast it to Integer. When you run above program, you will get below output: Math.pow(2 ,4)=16 Internal working Math.pow is native

The post Power function in java appeared first on Java2Blog.

Read: Power function in java

Topic: Power function in java Previous Topic   Next Topic Topic: Alternatives for Agile and Lean Roadmapping: Part 2, Rolling Wave Planning Inside One Quarter

Sponsored Links


Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use