Back to Intellij Community

ConstantMathCall

java/java-impl/resources/inspectionDescriptions/ConstantMathCall.html

2025.3-rc-2231 B
Original Source

Reports calls to java.lang.Math or java.lang.StrictMath methods that can be replaced with simple compile-time constants.

Example:

double v = Math.sin(0.0);

After the quick-fix is applied:

double v = 0.0;