/** * A fractional number type with typeclass instances. **Note:** this data type shouldn't * be used for computations involving large numbers, because the lawfulness of these * particular instances breaks down due to floating point error quicker than the others by * the nature of reducing fractional values * * @since 1.0.0 */ import * as Bnd from 'fp-ts/Bounded'; import * as Eq_ from 'fp-ts/Eq'; import * as IO from 'fp-ts/IO'; import * as Fld from 'fp-ts/Field'; import * as Mg from 'fp-ts/Magma'; import * as Mn from 'fp-ts/Monoid'; import * as Sg from 'fp-ts/Semigroup'; import * as Ord_ from 'fp-ts/Ord'; import * as O from 'fp-ts/Option'; import * as Sh from 'fp-ts/Show'; import * as Inf from './infix'; import * as Int from './integer'; import * as M from './Matrix'; import * as V from './Vector'; declare const RationalSymbol: unique symbol; declare type RationalSymbol = typeof RationalSymbol; /** * @since 1.0.0 * @category Model */ export interface Rational { readonly _URI: RationalSymbol; readonly top: Int.Int; readonly bottom: Int.Int; } /** * @since 1.0.0 * @category Constructors */ export declare const of: (top: Int.Int, bottom: Int.Int) => O.Option; /** * @since 1.0.0 * @category Constructors */ export declare const zero: Rational; /** * @since 1.0.0 * @category Constructors */ export declare const one: Rational; /** * @since 1.0.0 * @category Constructors */ export declare const fromInt: (top: Int.Int) => Rational; /** * @since 1.0.0 * @category Constructors */ export declare const randRational: (low: number, high: number) => IO.IO; /** * @since 1.0.0 * @category Instances */ export declare const Eq: Eq_.Eq; /** * @since 1.0.0 * @category Instances */ export declare const Ord: Ord_.Ord; /** * @since 1.0.0 * @category Instances */ export declare const Bounded: Bnd.Bounded; /** * @since 1.0.0 * @category Instances */ export declare const MagmaSub: Mg.Magma; /** * @since 1.0.0 * @category Instances */ export declare const SemigroupSum: Sg.Semigroup; /** * @since 1.0.0 * @category Instances */ export declare const SemigroupProduct: Sg.Semigroup; /** * @since 1.0.0 * @category Instances */ export declare const MonoidSum: Mn.Monoid; /** * @since 1.0.0 * @category Instances */ export declare const MonoidProduct: Mn.Monoid; /** * Adapted from Purescript: * https://github.com/purescript/purescript-prelude/blob/v6.0.0/src/Data/EuclideanRing.js * * @since 1.0.0 * @category Instances */ export declare const Field: Fld.Field; /** * @since 1.0.0 * @category Instances */ export declare const Show: Sh.Show; /** * @since 1.0.0 * @category Infix */ export declare const _: (a: Rational, s: Inf.FieldSymbol, b: Rational) => Rational; /** * @since 1.0.0 * @category Infix */ export declare const $_: (s: Inf.FieldSymbol, x: Rational, y: Rational) => Rational; /** * @since 1.0.0 * @category Infix */ export declare const _$: (a: Rational, b: Rational, s: Inf.FieldSymbol) => Rational; /** * @since 1.0.0 * @category Destructors */ export declare const toNumber: (r: Rational) => number; /** * @since 1.0.0 * @category Rational Ops */ export declare const abs: (a: Rational) => Rational; /** * @since 1.0.0 * @category Model */ export declare type Vec = V.Vec; /** * @since 1.0.0 * @category Instances */ export declare const AdditiveAbGrpN: (n: N) => import("./typeclasses").AbelianGroup>; /** * @since 1.0.0 * @category Instances */ export declare const BiModN: (n: N) => import("./typeclasses").Bimodule, Rational, Rational>; /** * @since 1.0.0 * @category Model */ export declare type Mat = M.Mat; /** * @since 1.0.0 * @category Instances */ export declare const AdditiveAbGrpMN: (m: M, n: N) => import("./typeclasses").AbelianGroup>; /** * @since 1.0.0 * @category Instances */ export declare const BiModMN: (m: M, n: N) => import("./typeclasses").Bimodule, Rational, Rational>; /** * @since 1.0.0 * @category Aliases */ export declare const add: (x: Rational, y: Rational) => Rational; /** * @since 1.0.0 * @category Aliases */ export declare const sub: (x: Rational, y: Rational) => Rational; /** * @since 1.0.0 * @category Aliases */ export declare const mul: (x: Rational, y: Rational) => Rational; /** * @since 1.0.0 * @category Aliases */ export declare const div: (x: Rational, y: Rational) => Rational; export {}; //# sourceMappingURL=rational.d.ts.map