Skip to content

Commit f325987

Browse files
committed
Fixed typo in math.factorial()
1 parent a70eec5 commit f325987

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public int factorialBoolean(@SuppressWarnings("unused") boolean value) {
367367

368368
@Specialization(guards = {"value < 0"})
369369
public long factorialNegativeInt(@SuppressWarnings("unused") int value) {
370-
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFNED_FOR_NEGATIVE);
370+
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFINED_FOR_NEGATIVE);
371371
}
372372

373373
@Specialization(guards = {"0 <= value", "value < SMALL_FACTORIALS.length"})
@@ -382,7 +382,7 @@ public PInt factorialInt(int value) {
382382

383383
@Specialization(guards = {"value < 0"})
384384
public long factorialNegativeLong(@SuppressWarnings("unused") long value) {
385-
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFNED_FOR_NEGATIVE);
385+
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFINED_FOR_NEGATIVE);
386386
}
387387

388388
@Specialization(guards = {"0 <= value", "value < SMALL_FACTORIALS.length"})
@@ -397,7 +397,7 @@ public PInt factorialLong(long value) {
397397

398398
@Specialization(guards = "isNegative(value)")
399399
public Object factorialPINegative(@SuppressWarnings("unused") PInt value) {
400-
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFNED_FOR_NEGATIVE);
400+
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFINED_FOR_NEGATIVE);
401401
}
402402

403403
@Specialization(guards = "isOvf(value)")
@@ -427,7 +427,7 @@ public long factorialDoubleInfinite(@SuppressWarnings("unused") double value) {
427427

428428
@Specialization(guards = "isNegative(value)")
429429
public PInt factorialDoubleNegative(@SuppressWarnings("unused") double value) {
430-
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFNED_FOR_NEGATIVE);
430+
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFINED_FOR_NEGATIVE);
431431
}
432432

433433
@Specialization(guards = "!isInteger(value)")
@@ -461,7 +461,7 @@ public long factorialPFLInfinite(@SuppressWarnings("unused") PFloat value) {
461461

462462
@Specialization(guards = "isNegative(value.getValue())")
463463
public PInt factorialPFLNegative(@SuppressWarnings("unused") PFloat value) {
464-
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFNED_FOR_NEGATIVE);
464+
throw raise(PythonErrorType.ValueError, ErrorMessages.FACTORIAL_NOT_DEFINED_FOR_NEGATIVE);
465465
}
466466

467467
@Specialization(guards = "!isInteger(value.getValue())")

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/ErrorMessages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public abstract class ErrorMessages {
190190
public static final String EXPECTED_STR_BYTE_OSPATHLIKE_OBJ = "expected str, bytes or os.PathLike object, not %p";
191191
public static final String EXPECTED_UNICODE_CHAR_NOT_P = "expected a unicode character, not %p";
192192
public static final String EXPONENT_TOO_LARGE = "exponent too large";
193-
public static final String FACTORIAL_NOT_DEFNED_FOR_NEGATIVE = "factorial() not defined for negative values";
193+
public static final String FACTORIAL_NOT_DEFINED_FOR_NEGATIVE = "factorial() not defined for negative values";
194194
public static final String FILE_NOT_OPENED_FOR_READING = "file not opened for reading";
195195
public static final String FILL_CHAR_MUST_BE_LENGTH_1 = "The fill character must be exactly one character long";
196196
public static final String FILTER_SPEC_MUST_BE_DICT = "Filter specifier must be a dict or dict-like object";

0 commit comments

Comments
 (0)