QueryOperationIsZero is a specific implementation of the QueryOperation trait for operations that check whether a given numeric value is equal to zero.
This case object provides functions for Int, Rational, and Double inputs, determining if the numeric value is zero. The results of these functions are encapsulated in a Try to capture potential exceptions during the operation.
The behavior of the functions is defined as follows:
For Int, it checks if the value is equal to 0.
For Rational, it checks if the signum of the value is 0.
For Double, it checks if the sign is 0 or -0, accounting for floating-point representation.
This implementation ensures consistent behavior across different numeric types while providing failure handling through the Try wrapper.
Returns an instance of BooleanQueryFunctions containing functions that evaluate whether the given numeric input is zero. These functions are encapsulated in a Try to handle potential exceptions gracefully.
Returns an instance of BooleanQueryFunctions containing functions that evaluate whether the given numeric input is zero. These functions are encapsulated in a Try to handle potential exceptions gracefully.
Attributes
Returns
BooleanQueryFunctions with three specific functions: - For Int: Checks if the value is equal to 0. - For Rational: Checks if the signum of the value is 0. - For Double: Checks if the sign is 0 or -0, accounting for floating-point representation.