Exactitude

com.phasmidsoftware.number.algebra.core.Exactitude
trait Exactitude

A trait representing the concept of exactness in a value or entity.

The Exactitude trait provides a contract for determining whether an entity is represented exactly or as an approximation. This trait can be implemented by classes or objects that wish to encapsulate the notion of exactness and approximate values.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Valuable
trait Lazy
trait Expression
class Noop
trait Root
class AbstractRoot
class LinearRoot
object L2
object LgE
class Literal
object E
object I
object Infinity
object Half
object MinusOne
object One
object Pi
object Two
object Zero
class Euler
trait Multiple
class Aggregate
class BiFunction
class UniFunction
trait Eager
trait Nat
object NatZero
class Succ
trait Solution
trait Algebraic
class Complex
trait Structure
trait Functional
trait Radians
class Angle
trait Transformed
class Exponential
class InversePower
trait Scalar
object NoScalar
trait Number
trait ExactNumber
class WholeNumber
class Real
Show all

Members list

Value members

Abstract methods

def isExact: Boolean

Determines whether this object is exact, i.e., is not any kind of approximation.

Determines whether this object is exact, i.e., is not any kind of approximation.

CONSIDER it may be possible that there are non-approximatable entities that are not exact either.

The method returns true if the value is represented exactly in IEEE 754 format, or Two's complement or the exact value must be represented symbolically. Examples of the first type include the number one (represented here as either WholeNumber(1) or Succ(NatZero). Examples of the second type include 1.5 or the square root of two (represented here as InversePower(2,2)).

When we are forced to approximate a value, for example when we want to print the decimal value of 𝛗, the Golden Ratio, then we mark such a representation as approximate, i.e., this method returns false.

Attributes

Returns

a Boolean indicating whether the entity is exact (true) or is an approximation (false).