Is it integer?

Inputs

  • Number

Outputs

  • Is it integer?

Neuron type

Best algorithm has been found - locked

Patterns

Pattern Input Output
1.
Number: 34
Is it integer?: 1
2.
Number: 7.0
Is it integer?: 1
3.
Number: -77
Is it integer?: 1
4.
Number: 4.8
Is it integer?: 0
5.
Number: 55.887
Is it integer?: 0
6.
Number: -6.01
Is it integer?: 0

Applicable neurons

  • a = b
  • Round to an integer
  • Rounding to whole tenths of something
  • Rounding to whole hundredths of something
  • Rounding to whole thousands of something
  • a is not b
  • Rounding to whole ten thousands of something
  • IF a=b THEN c ELSE d
  • Decimal part of a number
  • IF (1) THEN a ELSE b
  • If number is without decimal part then X else Y
  • AND
  • Sine (sinus) - degrees
  • >, < opposite
  • A-Z
  • \\d
  • .

Algorithm

Test

Code made by AI:
/**
 * Round to an integer: round(x)
 *
 * @param x1 Value
 * @return {Array}
 */
function neuron620(x1)
{
return[Math.round(Number(x1))]
}

/**
 * a = b: IF a=b THEN 1 ELSE 0;
 *
 * @param x1 a
 * @param x2 b
 * @return {Array}
 */
function neuron591(x1, x2)
{
return [(x1 == x2) ? 1 : 0];
}

/**
 * Is it integer?: 
 * 
 * @param x1 Number
 * @return {Array}
 */
function neuron914(x1)
{
  var outputs = [];
  outputs[0] = x1;

  arr = neuron620(outputs[0]);
  outputs[1] = arr[0];

  arr = neuron591(outputs[1], outputs[0]);
  outputs[2] = arr[0];

  return[outputs[2]];
}


Code made by AI:

Create your family tree for free