QueryOperationIsZero

com.phasmidsoftware.number.core.inner.QueryOperationIsZero
case object QueryOperationIsZero extends QueryOperation[Boolean]

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.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait QueryOperation[Boolean]
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Inherited types

type MirroredElemLabels = EmptyTuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Singleton
type MirroredElemTypes = EmptyTuple

Attributes

Inherited from:
Singleton
type MirroredMonoType = this.type

The mirrored *-type.

The mirrored *-type.

Attributes

Inherited from:
Singleton
type MirroredType = this.type

Attributes

Inherited from:
Singleton

Inherited and Abstract types

type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Inherited methods

def fromProduct(p: Product): MirroredMonoType

Creates a new instance of type T with elements taken from product p.

Creates a new instance of type T with elements taken from product p.

Attributes

Inherited from:
Singleton
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product

Concrete fields

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.