trait IsReal[A <: Data] extends Order[A] with Signed[A]
A simple type class for numeric types that are a subset of the reals.
- Alphabetic
- By Inheritance
- IsReal
- Signed
- Order
- PartialOrder
- Eq
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
abs(a: A): A
An idempotent function that ensures an object has a non-negative sign.
An idempotent function that ensures an object has a non-negative sign.
- Definition Classes
- Signed
-
abstract
def
ceil(a: A): A
Rounds
a
the nearest integer that is greater than or equal toa
. -
abstract
def
compare(x: A, y: A): ComparisonBundle
- Definition Classes
- Order
-
abstract
def
context_abs(a: A): A
- Definition Classes
- Signed
-
abstract
def
floor(a: A): A
Rounds
a
the nearest integer that is less than or equal toa
. -
abstract
def
getClass(): Class[_]
- Definition Classes
- Any
-
abstract
def
isWhole(a: A): Bool
Returns
true
iffa
is a an integer. -
abstract
def
round(a: A): A
Rounds
a
to the nearest integer (When the fractional part is 0.5, tie breaking rounds to positive infinity i.e.Rounds
a
to the nearest integer (When the fractional part is 0.5, tie breaking rounds to positive infinity i.e. round half up) -
abstract
def
signum(a: A): ComparisonBundle
Returns 0 if
a
is 0, > 0 ifa
is positive, and < 0 isa
is negative.Returns 0 if
a
is 0, > 0 ifa
is positive, and < 0 isa
is negative.- Definition Classes
- Signed
- abstract def truncate(a: A): A
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
equals(arg0: Any): Boolean
- Definition Classes
- Any
-
def
eqv(x: A, y: A): Bool
Returns
true
ifx
andy
are equivalent,false
otherwise.Returns
true
ifx
andy
are equivalent,false
otherwise.- Definition Classes
- Order → PartialOrder → Eq
-
def
gt(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
-
def
gteqv(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
-
def
hashCode(): Int
- Definition Classes
- Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSignNegative(a: A): Bool
- Definition Classes
- Signed
-
def
isSignNonNegative(a: A): Bool
- Definition Classes
- Signed
-
def
isSignNonPositive(a: A): Bool
- Definition Classes
- Signed
-
def
isSignNonZero(a: A): Bool
- Definition Classes
- Signed
-
def
isSignPositive(a: A): Bool
- Definition Classes
- Signed
-
def
isSignZero(a: A): Bool
- Definition Classes
- Signed
-
def
lt(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
-
def
lteqv(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
-
def
max(x: A, y: A): A
- Definition Classes
- Order
-
def
min(x: A, y: A): A
- Definition Classes
- Order
-
def
neqv(x: A, y: A): Bool
Returns
false
ifx
andy
are equivalent,true
otherwise.Returns
false
ifx
andy
are equivalent,true
otherwise.- Definition Classes
- Eq
-
def
on[B <: Data](f: (B) ⇒ A): Order[B]
Defines an order on
B
by mappingB
toA
usingf
and usingA
s order to orderB
.Defines an order on
B
by mappingB
toA
usingf
and usingA
s order to orderB
.- Definition Classes
- Order → PartialOrder → Eq
-
def
partialCompare(x: A, y: A): ValidIO[ComparisonBundle]
Result of comparing
x
withy
.Result of comparing
x
withy
. Returns ValidIO[ComparisonBundle] withvalid
false if operands are not comparable. If operands are comparable,bits.lt
will be true ifx
<y
andbits.eq
will be true ifx
=y
- Definition Classes
- Order → PartialOrder
-
def
pmax(x: A, y: A): ValidIO[A]
Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.
Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.
- Definition Classes
- PartialOrder
-
def
pmin(x: A, y: A): ValidIO[A]
Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.
Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.
- Definition Classes
- PartialOrder
-
def
reverse: Order[A]
Defines an ordering on
A
where all arrows switch direction.Defines an ordering on
A
where all arrows switch direction.- Definition Classes
- Order → PartialOrder
-
def
sign(a: A): Sign
Returns Zero if
a
is 0, Positive ifa
is positive, and Negative isa
is negative.Returns Zero if
a
is 0, Positive ifa
is positive, and Negative isa
is negative.- Definition Classes
- Signed
-
def
toString(): String
- Definition Classes
- Any