isInteger property

  1. @useResult
bool get isInteger

Returns true if this number has no fractional part.

true for any int, and for a double whose value equals its rounded value (e.g. 2.0). Audited: 2026-06-12 11:26 EDT

Implementation

@useResult
bool get isInteger => this is int || (this is double && this == roundToDouble());