isNumberInteger function

bool isNumberInteger(
  1. num number, {
  2. int? epsilonExponent,
})

Checks if the input number is an integer. Returns true if the input number is an integer, false otherwise.

Implementation

bool isNumberInteger(num number, {int? epsilonExponent}) {
  final double roundedValue = number.roundToDouble();

  return nearlyEqual(number, roundedValue, epsilonExponent: epsilonExponent);
}