/*
Java Programming for Engineers
Julio Sanchez
Maria P. Canton
ISBN: 0849308100
Publisher: CRC Press
*/
// Java for Engineers
//Filename: ExpoDemo
//Reference: Chapter 23
//Description:
// Using the pow() function
strictfp class ExpoDemo
{
public static void main(String[] args)
{
// Display the square root of 2 using sqrt()
System.out.print(" sqrt(2.0) = ");
System.out.println(Math.sqrt(2.0));
// Calculate and display using pow()
System.out.print("pow(2.0, 0.5) = ");
System.out.println(Math.pow(2.0, 0.5));
System.out.println();
}
}
|