mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
@@ -157,7 +157,7 @@ Blockly.JavaScript['math_number_property'] = function(block) {
|
||||
'mathIsPrime',
|
||||
['function ' + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + '(n) {',
|
||||
' // https://en.wikipedia.org/wiki/Primality_test#Naive_methods',
|
||||
' if (n === 2 || n === 3) {',
|
||||
' if (n == 2 || n == 3) {',
|
||||
' return true;',
|
||||
' }',
|
||||
' // False if n is NaN, negative, is 1, or not whole.',
|
||||
|
||||
@@ -427,7 +427,7 @@ function test_constant() {
|
||||
|
||||
function mathIsPrime(n) {
|
||||
// https://en.wikipedia.org/wiki/Primality_test#Naive_methods
|
||||
if (n === 2 || n === 3) {
|
||||
if (n == 2 || n == 3) {
|
||||
return true;
|
||||
}
|
||||
// False if n is NaN, negative, is 1, or not whole.
|
||||
|
||||
Reference in New Issue
Block a user