Java

Java

Made by DeepSource

Imprecise redefinition of library constant JAVA-W1033

Anti-pattern
Major

A library constant has been redefined in source code with a different/imprecise value.

It's recommended to use the predefined library constant for code clarity and better precision.

Bad Practice

static final double PI_bad = 3.14;

double bad = 2 * PI_bad * radius;

Recommended

double good = 2 * Math.PI * radius;

References