# Fraction SΒΆ

fraction.spad line 251 [edit on github]

Fraction takes an IntegralDomain `S`

and produces the domain of Fractions with numerators and denominators from `S`

. If `S`

is also a GcdDomain, then `gcd`

`'s`

between numerator and denominator will be cancelled during all operations.

- 0: %
from AbelianMonoid

- 1: %
from MagmaWithUnit

- *: (%, %) -> %
from Magma

- *: (%, Fraction Integer) -> %
from RightModule Fraction Integer

- *: (%, Integer) -> % if S has LinearlyExplicitOver Integer
from RightModule Integer

- *: (%, S) -> %
from RightModule S

- *: (Fraction Integer, %) -> %
from LeftModule Fraction Integer

- *: (Integer, %) -> %
from AbelianGroup

- *: (NonNegativeInteger, %) -> %
from AbelianMonoid

- *: (PositiveInteger, %) -> %
from AbelianSemiGroup

- *: (S, %) -> %
from LeftModule S

- +: (%, %) -> %
from AbelianSemiGroup

- -: % -> %
from AbelianGroup

- -: (%, %) -> %
from AbelianGroup

- /: (%, %) -> %
from Field

- /: (S, S) -> %
from QuotientFieldCategory S

- <=: (%, %) -> Boolean if S has OrderedSet
from PartialOrder

- <: (%, %) -> Boolean if S has OrderedSet
from PartialOrder

- >=: (%, %) -> Boolean if S has OrderedSet
from PartialOrder

- >: (%, %) -> Boolean if S has OrderedSet
from PartialOrder

- ^: (%, Integer) -> %
from DivisionRing

- ^: (%, NonNegativeInteger) -> %
from MagmaWithUnit

- ^: (%, PositiveInteger) -> %
from Magma

- abs: % -> % if S has OrderedIntegralDomain
from OrderedRing

- annihilate?: (%, %) -> Boolean
from Rng

- antiCommutator: (%, %) -> %

- associates?: (%, %) -> Boolean
from EntireRing

- associator: (%, %, %) -> %
from NonAssociativeRng

- ceiling: % -> S if S has IntegerNumberSystem
from QuotientFieldCategory S

- characteristic: () -> NonNegativeInteger
from NonAssociativeRing

- charthRoot: % -> Union(%, failed) if S has CharacteristicNonZero or % has CharacteristicNonZero and S has PolynomialFactorizationExplicit

- coerce: % -> %
from Algebra %

- coerce: % -> OutputForm
from CoercibleTo OutputForm

- coerce: Fraction Integer -> %
from CoercibleFrom Fraction Integer

- coerce: Integer -> %
from NonAssociativeRing

- coerce: S -> %
from CoercibleFrom S

- coerce: Symbol -> % if S has RetractableTo Symbol
from CoercibleFrom Symbol

- commutator: (%, %) -> %
from NonAssociativeRng

- conditionP: Matrix % -> Union(Vector %, failed) if % has CharacteristicNonZero and S has PolynomialFactorizationExplicit

- convert: % -> DoubleFloat if S has RealConstant
from ConvertibleTo DoubleFloat

- convert: % -> Float if S has RealConstant
from ConvertibleTo Float

- convert: % -> InputForm if S has ConvertibleTo InputForm
from ConvertibleTo InputForm

- convert: % -> Pattern Float if S has ConvertibleTo Pattern Float
from ConvertibleTo Pattern Float

- convert: % -> Pattern Integer if S has ConvertibleTo Pattern Integer
from ConvertibleTo Pattern Integer

- D: % -> % if S has DifferentialRing
from DifferentialRing

- D: (%, List Symbol) -> % if S has PartialDifferentialRing Symbol
- D: (%, List Symbol, List NonNegativeInteger) -> % if S has PartialDifferentialRing Symbol
- D: (%, NonNegativeInteger) -> % if S has DifferentialRing
from DifferentialRing

- D: (%, S -> S) -> %
from DifferentialExtension S

- D: (%, S -> S, NonNegativeInteger) -> %
from DifferentialExtension S

- D: (%, Symbol) -> % if S has PartialDifferentialRing Symbol
- D: (%, Symbol, NonNegativeInteger) -> % if S has PartialDifferentialRing Symbol

- denom: % -> S
from QuotientFieldCategory S

- denominator: % -> %
from QuotientFieldCategory S

- differentiate: % -> % if S has DifferentialRing
from DifferentialRing

- differentiate: (%, List Symbol) -> % if S has PartialDifferentialRing Symbol
- differentiate: (%, List Symbol, List NonNegativeInteger) -> % if S has PartialDifferentialRing Symbol
- differentiate: (%, NonNegativeInteger) -> % if S has DifferentialRing
from DifferentialRing

- differentiate: (%, S -> S) -> %
from DifferentialExtension S

- differentiate: (%, S -> S, NonNegativeInteger) -> %
from DifferentialExtension S

- differentiate: (%, Symbol) -> % if S has PartialDifferentialRing Symbol
- differentiate: (%, Symbol, NonNegativeInteger) -> % if S has PartialDifferentialRing Symbol

- divide: (%, %) -> Record(quotient: %, remainder: %)
from EuclideanDomain

- euclideanSize: % -> NonNegativeInteger
from EuclideanDomain

- eval: (%, Equation S) -> % if S has Evalable S
from Evalable S

- eval: (%, List Equation S) -> % if S has Evalable S
from Evalable S

- eval: (%, List S, List S) -> % if S has Evalable S
from InnerEvalable(S, S)

- eval: (%, List Symbol, List S) -> % if S has InnerEvalable(Symbol, S)
from InnerEvalable(Symbol, S)

- eval: (%, S, S) -> % if S has Evalable S
from InnerEvalable(S, S)

- eval: (%, Symbol, S) -> % if S has InnerEvalable(Symbol, S)
from InnerEvalable(Symbol, S)

- expressIdealMember: (List %, %) -> Union(List %, failed)
from PrincipalIdealDomain

- exquo: (%, %) -> Union(%, failed)
from EntireRing

- extendedEuclidean: (%, %) -> Record(coef1: %, coef2: %, generator: %)
from EuclideanDomain

- extendedEuclidean: (%, %, %) -> Union(Record(coef1: %, coef2: %), failed)
from EuclideanDomain

- factorFraction: % -> Fraction Factored S if S has UniqueFactorizationDomain
`factorFraction(r)`

factors the numerator and the denominator of the fraction`r`

.

- factorPolynomial: SparseUnivariatePolynomial % -> Factored SparseUnivariatePolynomial % if S has PolynomialFactorizationExplicit

- factorSquareFreePolynomial: SparseUnivariatePolynomial % -> Factored SparseUnivariatePolynomial % if S has PolynomialFactorizationExplicit

- floor: % -> S if S has IntegerNumberSystem
from QuotientFieldCategory S

- fractionPart: % -> % if S has EuclideanDomain
from QuotientFieldCategory S

- gcdPolynomial: (SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial %

- hash: % -> SingleInteger if S has Hashable
from Hashable

- hashUpdate!: (HashState, %) -> HashState if S has Hashable
from Hashable

- init: % if S has StepThrough
from StepThrough

- inv: % -> %
from DivisionRing

- latex: % -> String
from SetCategory

- lcmCoef: (%, %) -> Record(llcm_res: %, coeff1: %, coeff2: %)
from LeftOreRing

- leftPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit

- leftPower: (%, PositiveInteger) -> %
from Magma

- leftRecip: % -> Union(%, failed)
from MagmaWithUnit

- map: (S -> S, %) -> %
from FullyEvalableOver S

- max: (%, %) -> % if S has OrderedSet
from OrderedSet

- min: (%, %) -> % if S has OrderedSet
from OrderedSet

- multiEuclidean: (List %, %) -> Union(List %, failed)
from EuclideanDomain

- negative?: % -> Boolean if S has OrderedIntegralDomain
from OrderedRing

- nextItem: % -> Union(%, failed) if S has StepThrough
from StepThrough

- numer: % -> S
from QuotientFieldCategory S

- numerator: % -> %
from QuotientFieldCategory S

- OMwrite: % -> String if S has OpenMath and S has IntegerNumberSystem
from OpenMath

- OMwrite: (%, Boolean) -> String if S has OpenMath and S has IntegerNumberSystem
from OpenMath

- OMwrite: (OpenMathDevice, %) -> Void if S has OpenMath and S has IntegerNumberSystem
from OpenMath

- OMwrite: (OpenMathDevice, %, Boolean) -> Void if S has OpenMath and S has IntegerNumberSystem
from OpenMath

- one?: % -> Boolean
from MagmaWithUnit

- opposite?: (%, %) -> Boolean
from AbelianMonoid

- patternMatch: (%, Pattern Float, PatternMatchResult(Float, %)) -> PatternMatchResult(Float, %) if S has PatternMatchable Float
from PatternMatchable Float

- patternMatch: (%, Pattern Integer, PatternMatchResult(Integer, %)) -> PatternMatchResult(Integer, %) if S has PatternMatchable Integer
from PatternMatchable Integer

- plenaryPower: (%, PositiveInteger) -> %
from NonAssociativeAlgebra %

- positive?: % -> Boolean if S has OrderedIntegralDomain
from OrderedRing

- principalIdeal: List % -> Record(coef: List %, generator: %)
from PrincipalIdealDomain

- quo: (%, %) -> %
from EuclideanDomain

- recip: % -> Union(%, failed)
from MagmaWithUnit

- reducedSystem: (Matrix %, Vector %) -> Record(mat: Matrix Integer, vec: Vector Integer) if S has LinearlyExplicitOver Integer
- reducedSystem: (Matrix %, Vector %) -> Record(mat: Matrix S, vec: Vector S)
from LinearlyExplicitOver S

- reducedSystem: Matrix % -> Matrix Integer if S has LinearlyExplicitOver Integer
- reducedSystem: Matrix % -> Matrix S
from LinearlyExplicitOver S

- rem: (%, %) -> %
from EuclideanDomain

- retract: % -> Fraction Integer if S has RetractableTo Integer
from RetractableTo Fraction Integer

- retract: % -> Integer if S has RetractableTo Integer
from RetractableTo Integer

- retract: % -> S
from RetractableTo S

- retract: % -> Symbol if S has RetractableTo Symbol
from RetractableTo Symbol

- retractIfCan: % -> Union(Fraction Integer, failed) if S has RetractableTo Integer
from RetractableTo Fraction Integer

- retractIfCan: % -> Union(Integer, failed) if S has RetractableTo Integer
from RetractableTo Integer

- retractIfCan: % -> Union(S, failed)
from RetractableTo S

- retractIfCan: % -> Union(Symbol, failed) if S has RetractableTo Symbol
from RetractableTo Symbol

- rightPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit

- rightPower: (%, PositiveInteger) -> %
from Magma

- rightRecip: % -> Union(%, failed)
from MagmaWithUnit

- sample: %
from AbelianMonoid

- sign: % -> Integer if S has OrderedIntegralDomain
from OrderedRing

- sizeLess?: (%, %) -> Boolean
from EuclideanDomain

- smaller?: (%, %) -> Boolean if S has Comparable
from Comparable

- solveLinearPolynomialEquation: (List SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> Union(List SparseUnivariatePolynomial %, failed) if S has PolynomialFactorizationExplicit

- squareFree: % -> Factored %

- squareFreePart: % -> %

- squareFreePolynomial: SparseUnivariatePolynomial % -> Factored SparseUnivariatePolynomial % if S has PolynomialFactorizationExplicit

- subtractIfCan: (%, %) -> Union(%, failed)

- unit?: % -> Boolean
from EntireRing

- unitCanonical: % -> %
from EntireRing

- unitNormal: % -> Record(unit: %, canonical: %, associate: %)
from EntireRing

- wholePart: % -> S if S has EuclideanDomain
from QuotientFieldCategory S

- zero?: % -> Boolean
from AbelianMonoid

Algebra %

Algebra S

BiModule(%, %)

BiModule(Fraction Integer, Fraction Integer)

BiModule(S, S)

Canonical if S has GcdDomain and S has Canonical and S has canonicalUnitNormal

CharacteristicNonZero if S has CharacteristicNonZero

CharacteristicZero if S has CharacteristicZero

CoercibleFrom Fraction Integer if S has RetractableTo Integer

CoercibleFrom Integer if S has RetractableTo Integer

CoercibleFrom Symbol if S has RetractableTo Symbol

Comparable if S has Comparable

ConvertibleTo DoubleFloat if S has RealConstant

ConvertibleTo Float if S has RealConstant

ConvertibleTo InputForm if S has ConvertibleTo InputForm

ConvertibleTo Pattern Float if S has ConvertibleTo Pattern Float

ConvertibleTo Pattern Integer if S has ConvertibleTo Pattern Integer

DifferentialRing if S has DifferentialRing

Eltable(S, %) if S has Eltable(S, S)

Evalable S if S has Evalable S

InnerEvalable(S, S) if S has Evalable S

InnerEvalable(Symbol, S) if S has InnerEvalable(Symbol, S)

LinearlyExplicitOver Integer if S has LinearlyExplicitOver Integer

Module %

Module S

NonAssociativeAlgebra Fraction Integer

OpenMath if S has OpenMath and S has IntegerNumberSystem

OrderedAbelianGroup if S has OrderedIntegralDomain

OrderedAbelianMonoid if S has OrderedIntegralDomain

OrderedAbelianSemiGroup if S has OrderedIntegralDomain

OrderedCancellationAbelianMonoid if S has OrderedIntegralDomain

OrderedIntegralDomain if S has OrderedIntegralDomain

OrderedRing if S has OrderedIntegralDomain

OrderedSet if S has OrderedSet

PartialDifferentialRing Symbol if S has PartialDifferentialRing Symbol

PartialOrder if S has OrderedSet

PatternMatchable Float if S has PatternMatchable Float

PatternMatchable Integer if S has PatternMatchable Integer

PolynomialFactorizationExplicit if S has PolynomialFactorizationExplicit

RealConstant if S has RealConstant

RetractableTo Fraction Integer if S has RetractableTo Integer

RetractableTo Integer if S has RetractableTo Integer

RetractableTo Symbol if S has RetractableTo Symbol

RightModule Integer if S has LinearlyExplicitOver Integer

StepThrough if S has StepThrough