bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math getExponent() Method

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java Math getExponent() Method?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___.out.println(Math.getExponent(1));
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The getExponent() method returns the unbiased exponent of Java's internal representation of a floating point number.
Definition and Usage
Java Math getExponent() Method

❮ Math Methods

Example

System.out.println(Math.getExponent(1));
System.out.println(Math.getExponent(2));
System.out.println(Math.getExponent(-8));
System.out.println(Math.getExponent(10));
System.out.println(Math.getExponent(0.5));
System.out.println(Math.getExponent(-0.33));

Definition and Usage

The getExponent() method returns the unbiased exponent of Java's internal representation of a floating point number.

Java represents every floating point number internally in the form m·2 x . The getExponent() method returns the value of x for any floating point number. The term unbiased refers to the fact that the exponent can only be represented internally as a positive number, so there is a positive bias to the exponent. When you subtract the bias from the exponent you get the unbiased (true) value of the exponent.

One of the following

public static int getExponent(double
number )
public static int getExponent(float
number )

Parameter Values

ParameterDescription
numberRequired. A floating point number from which to get the exponent.

Technical Details

Returns:An int value representing the unbiased exponent of Java's internal representation of a floating point number.
Java version:1.6+

Previous

Java Math floorMod() Method

Next

Java Math hypot() Method