Skip to content

Commit e0e002b

Browse files
committed
Fixed style
1 parent 5cba922 commit e0e002b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/CmathModuleBuiltins.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public class CmathModuleBuiltins extends PythonBuiltins {
4949
static final double P12 = 0.5 * Math.PI;
5050
static final double P34 = 0.75 * Math.PI;
5151

52-
static final double largeDouble = Double.MAX_VALUE / 4.0; // used to avoid overflow
53-
static final double ln2 = 0.6931471805599453094; // natural log of 2
54-
static final double ln10 = 2.302585092994045684; // natural log of 10
52+
static final double LARGE_DOUBLE = Double.MAX_VALUE / 4.0; // used to avoid overflow
53+
static final double LN_2 = 0.6931471805599453094; // natural log of 2
54+
static final double LN_10 = 2.302585092994045684; // natural log of 10
5555

5656
@Override
5757
protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFactories() {
@@ -437,13 +437,13 @@ private double computeRealPart(double real, double imag) {
437437
double ax = Math.abs(real);
438438
double ay = Math.abs(imag);
439439

440-
if (ax > largeDouble || ay > largeDouble) {
441-
return Math.log(Math.hypot(ax / 2.0, ay / 2.0)) + ln2;
440+
if (ax > LARGE_DOUBLE || ay > LARGE_DOUBLE) {
441+
return Math.log(Math.hypot(ax / 2.0, ay / 2.0)) + LN_2;
442442
}
443443
if (ax < Double.MIN_NORMAL && ay < Double.MIN_NORMAL) {
444444
if (ax > 0.0 || ay > 0.0) {
445445
final double scaleUp = 0x1.0p53;
446-
return Math.log(Math.hypot(ax * scaleUp, ay * scaleUp)) - 53 * ln2;
446+
return Math.log(Math.hypot(ax * scaleUp, ay * scaleUp)) - 53 * LN_2;
447447
}
448448
throw raise(ValueError, ErrorMessages.MATH_DOMAIN_ERROR);
449449
}
@@ -467,7 +467,7 @@ abstract static class Log10Node extends PythonUnaryBuiltinNode {
467467
@Specialization
468468
PComplex doComplex(VirtualFrame frame, PComplex z) {
469469
PComplex r = logNode.executeComplex(frame, z, PNone.NO_VALUE);
470-
return factory().createComplex(r.getReal() / ln10, r.getImag() / ln10);
470+
return factory().createComplex(r.getReal() / LN_10, r.getImag() / LN_10);
471471
}
472472

473473
@Specialization
@@ -559,9 +559,9 @@ PComplex compute(VirtualFrame frame, double real, double imag) {
559559

560560
double rreal;
561561
double rimag;
562-
if (Math.abs(real) > largeDouble || Math.abs(imag) > largeDouble) {
562+
if (Math.abs(real) > LARGE_DOUBLE || Math.abs(imag) > LARGE_DOUBLE) {
563563
rreal = Math.atan2(Math.abs(imag), real);
564-
double s = Math.log(Math.hypot(real / 2.0, imag / 2.0)) + ln2 * 2.0;
564+
double s = Math.log(Math.hypot(real / 2.0, imag / 2.0)) + LN_2 * 2.0;
565565
if (real < 0.0) {
566566
rimag = -Math.copySign(s, imag);
567567
} else {

0 commit comments

Comments
 (0)