nc-photos/np_math/lib/src/num_extension.dart
2023-08-26 01:34:07 +08:00

11 lines
272 B
Dart

extension NumExtension on num {
bool inRange(
num beg,
num end, {
bool isBegInclusive = true,
bool isEndInclusive = true,
}) {
return (this > beg || (isBegInclusive && this == beg)) &&
(this < end || (isEndInclusive && this == end));
}
}