answersLogoWhite

0

What is the formula for base and power in java program?

Updated: 8/20/2019
User Avatar

Wiki User

12y ago

Best Answer
powpublic static double pow(double a, double b) Returns the value of the first argument raised to the power of the second argument. Special cases:
  • If the second argument is positive or negative zero, then the result is 1.0.
  • If the second argument is 1.0, then the result is the same as the first argument.
  • If the second argument is NaN, then the result is NaN.
  • If the first argument is NaN and the second argument is nonzero, then the result is NaN.
  • If
    • the absolute value of the first argument is greater than 1 and the second argument is positive infinity, or
    • the absolute value of the first argument is less than 1 and the second argument is negative infinity,
    then the result is positive infinity.
  • If
    • the absolute value of the first argument is greater than 1 and the second argument is negative infinity, or
    • the absolute value of the first argument is less than 1 and the second argument is positive infinity,
    then the result is positive zero.
  • If the absolute value of the first argument equals 1 and the second argument is infinite, then the result is NaN.
  • If
    • the first argument is positive zero and the second argument is greater than zero, or
    • the first argument is positive infinity and the second argument is less than zero,
    then the result is positive zero.
  • If
    • the first argument is positive zero and the second argument is less than zero, or
    • the first argument is positive infinity and the second argument is greater than zero,
    then the result is positive infinity.
  • If
    • the first argument is negative zero and the second argument is greater than zero but not a finite odd integer, or
    • the first argument is negative infinity and the second argument is less than zero but not a finite odd integer,
    then the result is positive zero.
  • If
    • the first argument is negative zero and the second argument is a positive finite odd integer, or
    • the first argument is negative infinity and the second argument is a negative finite odd integer,
    then the result is negative zero.
  • If
    • the first argument is negative zero and the second argument is less than zero but not a finite odd integer, or
    • the first argument is negative infinity and the second argument is greater than zero but not a finite odd integer,
    then the result is positive infinity.
  • If
    • the first argument is negative zero and the second argument is a negative finite odd integer, or
    • the first argument is negative infinity and the second argument is a positive finite odd integer,
    then the result is negative infinity.
  • If the first argument is finite and less than zero
    • if the second argument is a finite even integer, the result is equal to the result of raising the absolute value of the first argument to the power of the second argument
    • if the second argument is a finite odd integer, the result is equal to the negative of the result of raising the absolute value of the first argument to the power of the second argument
    • if the second argument is finite and not an integer, then the result is NaN.
  • If both arguments are integers, then the result is exactly equal to the mathematical result of raising the first argument to the power of the second argument if that result can in fact be represented exactly as a double value.

(In the foregoing descriptions, a floating-point value is considered to be an integer if and only if it is finite and a fixed point of the method ceil or, equivalently, a fixed point of the method floor. A value is a fixed point of a one-argument method if and only if the result of applying the method to the value is equal to the value.)

A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.Parameters:a - the base.b - the exponent.Returns:the value ab.

Taken from the Java api.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the formula for base and power in java program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the java sdk?

That's short for Software Development Kit, and it is basically everything the programmer (developer) needs to program in Java. It includes the Java compiler, the Java Virtual Machine, and the Java base classes.


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


What is java program on computers?

#!/usr/bin/perl print 'java program';


What is java virtucal mechine?

That refers to the program that runs the compiled Java program.


What powder game doesnt need java?

Any program written for the Java technology needs Java. Any program NOT written for Java DOESN'T need it.


Java Track?

Java Track is the java training program offered by SynergisticIT


Where can one get the program Java?

The program Java can be downloaded from the official Java website on the internet. The program is free for personal use, so it can be downloaded without any cost by anyone.


What is a Java applet?

PCH answer small Embedded Java Program.


Do I need Java?

No, if a program needs Java it'll specify that it does in the installer package for the program or on the website for the program or a section usually called "Requirements" for a specific program.


What is a java programming?

A java program is a program that is coded and run in the programming language called java. Java is similar to c++ in structure, and is more common in web apps. C++ is the equivalent for more heavy duty programs such as most software used to compose a java program.


Where java program started?

If it is already compiled, you can start your Java program from the command line. Just type java myclass replacing "myclass" with the program you want to start - a program with the ".class" extension, for example, myclass.class.


Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.