case class Ratio(n: Long, d: Long = 1) extends Ordered[Ratio] with Product with Serializable
- Source
- numeric.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Ratio
- Serializable
- Product
- Equals
- Ordered
- Comparable
- AnyRef
- Any
Implicitly
- by orderingToOrdered
- by richDrxAny
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def *(that: Ratio): Ratio
- def *(i: Long): Ratio
- def +(that: Ratio): Ratio
- def +(i: Long): Ratio
- def -(that: Ratio): Ratio
subtraction a/b - c/d => a*d / b*d - c*b / b*d => (a*d - c*b) / b*d
- def -(i: Long): Ratio
- def ->[B](y: B): (Ratio, B)
- def /(that: Ratio): Ratio
- def /(i: Long): Ratio
- def <(that: Ratio): Boolean
- Definition Classes
- Ordered
- def <=(that: Ratio): Boolean
- Definition Classes
- Ordered
- def ==(i: Long): Boolean
- def ==(that: Ratio): Boolean
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: Ratio): Boolean
- Definition Classes
- Ordered
- def >=(that: Ratio): Boolean
- Definition Classes
- Ordered
- def abs: Ratio
- def applyIf(t: Boolean, f: (Ratio) => Ratio): Ratio
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def applyIf(t: (Ratio) => Boolean)(f: (Ratio) => Ratio): Ratio
better chaining for types
better chaining for types
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compare(that: Ratio): Int
- Definition Classes
- Ratio → Ordered
- def compareTo(that: Ratio): Int
- Definition Classes
- Ordered → Comparable
- val d: Long
- def dB: Double
- def den: Long
- def diff(that: Ratio): Ratio
- def elementOf(xs: Set[Ratio]): Boolean
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def ensuring(cond: (Ratio) => Boolean, msg: => Any): Ratio
- def ensuring(cond: (Ratio) => Boolean): Ratio
- def ensuring(cond: Boolean, msg: => Any): Ratio
- def ensuring(cond: Boolean): Ratio
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- Ratio → Equals → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- lazy val gcd: Long
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- Ratio → AnyRef → Any
- def inv: Ratio
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log: Double
- def log(b: Double): Double
- def log10: Double
- def logE: Double
- val n: Long
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def neg: Ratio
- def noneIf(f: (Ratio) => Boolean): Option[Ratio]
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def not: Ratio
1-n/d => (d - n)/d
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def num: Long
- def optionIf(f: (Ratio) => Boolean): Option[Ratio]
optionally wrap an object
optionally wrap an object
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def percentString: String
- def preApply[B](f: (Ratio) => B): B
a preApply f => f(a)
a preApply f => f(a)
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def reduce: Ratio
- def sideEffect(f: (Ratio) => Unit): Ratio
side effect filter
side effect filter
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def someIf(f: (Ratio) => Boolean): Option[Ratio]
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val thisAny: Ratio
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- def toDouble: Double
- def todB: Double
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Shadowed Implicit Value Members
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from Ratio toany2stringadd[Ratio] performed by method any2stringadd in scala.Predef.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: any2stringadd[Ratio]).+(other)
- Definition Classes
- any2stringadd
- def <(that: Ratio): Boolean
- Implicit
- This member is added by an implicit conversion from Ratio toOrdered[Ratio] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: Ordered[Ratio]).<(that)
- Definition Classes
- Ordered
- def <=(that: Ratio): Boolean
- Implicit
- This member is added by an implicit conversion from Ratio toOrdered[Ratio] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: Ordered[Ratio]).<=(that)
- Definition Classes
- Ordered
- def >(that: Ratio): Boolean
- Implicit
- This member is added by an implicit conversion from Ratio toOrdered[Ratio] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: Ordered[Ratio]).>(that)
- Definition Classes
- Ordered
- def >=(that: Ratio): Boolean
- Implicit
- This member is added by an implicit conversion from Ratio toOrdered[Ratio] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: Ordered[Ratio]).>=(that)
- Definition Classes
- Ordered
- def compare(that: Ratio): Int
- Implicit
- This member is added by an implicit conversion from Ratio toOrdered[Ratio] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: Ordered[Ratio]).compare(that)
- Definition Classes
- Ordered
- def compareTo(that: Ratio): Int
- Implicit
- This member is added by an implicit conversion from Ratio toOrdered[Ratio] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(ratio: Ordered[Ratio]).compareTo(that)
- Definition Classes
- Ordered → Comparable
Deprecated Value Members
- def ?>(f: (Ratio) => Boolean): Option[Ratio]
alias for option if
alias for option if
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- Annotations
- @deprecated
- Deprecated
(Since version v0.2.15) to many symbols are hard to undertand
- def |>[B](f: (Ratio) => B): B
- Implicit
- This member is added by an implicit conversion from Ratio toDrxAny[Ratio] performed by method richDrxAny in cc.drx.predef.Enrich.
- Definition Classes
- DrxAny
- Annotations
- @deprecated
- Deprecated
(Since version v0.2.15) use
preApply
if you must (symbols are concise without concision)
- def →[B](y: B): (Ratio, B)
- Implicit
- This member is added by an implicit conversion from Ratio toArrowAssoc[Ratio] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.