VulgarFraction

com.phasmidsoftware.number.core.inner.VulgarFraction

The VulgarFraction object provides a mapping of common fractional values to their corresponding Unicode vulgar fraction characters. It also includes functionality to extract a Unicode representation of a vulgar fraction from a given Rational number.

This object uses a predefined Map of numerator and denominator pairs to their Unicode character equivalents.

The primary use case for this object is working with Rational numbers and converting them to their Unicode vulgar fraction representation when applicable.

Functionality:

  • Provides the mapping of common fractions to Unicode vulgar fraction characters.
  • Extracts a Unicode vulgar fraction character from a Rational number when possible.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(w: String): Option[Rational]
def unapply(x: Rational): Option[String]

Concrete fields

val mapping: Map[(Int, Int), String]
val reverseMapping: Map[String, (Int, Int)]