NumSignalExtension#
Kind:
extension |
Package: package:signals_core
Extension: NumSignalExtension#
extension NumSignalExtension on ReadonlySignal<num>
Helper extensions for ReadonlySignal.value.
import 'package:signals_core/signals_core.dart';
final a = 5.0.$;
final sum = a + 3; // 8.0 (evaluates reactively)
final isGreater = a > 4; // true
Members of NumSignalExtension#
| Member | Type | Signature | Description |
|---|---|---|---|
| + | method |
dart num +(num other) |
Adds other to this number. |
| - | method |
dart num -(num other) |
Subtracts other from this number. |
| ***** | method |
dart num *(num other) |
Multiplies this number by other. |
| % | method |
dart num %(num other) |
Euclidean modulo of this number by other. |
| / | method |
dart double /(num other) |
Divides this number by other. |
| ~/ | method |
dart int ~/(num other) |
Truncating division operator. |
| - | method |
dart num -() |
The negation of this value. |
| remainder | method |
dart num remainder(num other) |
The remainder of the truncating division of this by other. |
| < | method |
dart bool <(num other) |
Whether this number is numerically smaller than other. |
| <= | method |
dart bool <=(num other) |
Whether this number is numerically smaller than or equal to other. |
| > | method |
dart bool >(num other) |
Whether this number is numerically greater than other. |
| >= | method |
dart bool >=(num other) |
Whether this number is numerically greater than or equal to other. |
| isNaN | method |
dart bool isNaN |
Whether this number is a Not-a-Number value. |
| isNegative | method |
dart bool isNegative |
Whether this number is negative. |
| isInfinite | method |
dart bool isInfinite |
Whether this number is positive infinity or negative infinity. |
| isFinite | method |
dart bool isFinite |
Whether this number is finite. |
| abs | method |
dart num abs() |
The absolute value of this number. |
| sign | method |
dart num sign |
Negative one, zero or positive one depending on the sign and |
| round | method |
dart int round() |
The integer closest to this number. |
| floor | method |
dart int floor() |
The greatest integer no greater than this number. |
| ceil | method |
dart int ceil() |
The least integer no smaller than this. |
| truncate | method |
dart int truncate() |
The integer obtained by discarding any fractional digits from this. |
| roundToDouble | method |
dart double roundToDouble() |
The double integer value closest to this value. |
| floorToDouble | method |
dart double floorToDouble() |
Returns the greatest double integer value no greater than this. |
| ceilToDouble | method |
dart double ceilToDouble() |
Returns the least double integer value no smaller than this. |
| truncateToDouble | method |
dart double truncateToDouble() |
Returns the double integer value obtained by discarding any fractional |
| clamp | method |
dart num clamp(num lowerLimit, num upperLimit) |
Returns this num clamped to be in the range lowerLimit - upperLimit . |
| toInt | method |
dart int toInt() |
Truncates this num to an integer and returns the result as an int. |
| toDouble | method |
dart double toDouble() |
This number as a double. |
| toStringAsFixed | method |
dart String toStringAsFixed(int fractionDigits) |
A decimal-point string-representation of this number. |
| toStringAsExponential | method |
dart String toStringAsExponential([int? fractionDigits]) |
An exponential string-representation of this number. |
| toStringAsPrecision | method |
dart String toStringAsPrecision(int precision) |
A string representation with precision significant digits. |
References#
The NumSignalExtension type is referenced and used in the following pages: