GenUtils


BigRational

Namespace: Informedica.GenUtils.Lib

Helper functions for BigRational

Nested types and modules

TypeDescription
BigRationalException

Exception type

Message

Message type

Functions and values

Function or valueDescription
apply f x
Signature: f:(BigRational -> '?6749) -> x:BigRational -> '?6749
Type parameters: '?6749

Apply a f to bigrational x

fromInt arg00
Signature: arg00:int -> BigRational

Create a bigrational from an int

gcd a b
Signature: a:BigRational -> b:BigRational -> BigRational

Get the greatest common divisor of two bigrationals a and b

get
Signature: BigRational -> BigRational

Utility to enable type inference

isMultiple incr v
Signature: incr:BigRational -> v:BigRational -> bool

Checks whether v is a multiple of incr

one
Signature: BigRational

Constant 1

opIsAdd op
Signature: op:(BigRational -> BigRational -> BigRational) -> bool

Check whether the operator is addition

opIsDiv op
Signature: op:(BigRational -> BigRational -> BigRational) -> bool

Check whether the operator is divsion

opIsMult op
Signature: op:(BigRational -> BigRational -> BigRational) -> bool

Check whether the operator is multiplication

opIsSubtr op
Signature: op:(BigRational -> BigRational -> BigRational) -> bool

Check whether the operator is subtraction

optToString _arg1
Signature: _arg1:BigRational option -> string

Convert an optional BigRational to a string. If None then return empty string.

parse s
Signature: s:string -> BigRational

Parse a string to a bigrational

parseCont succ fail s
Signature: succ:(BigRational -> '?6753) -> fail:(Message -> '?6753) -> s:string -> '?6753
Type parameters: '?6753

Parse a string and pass the result either to succ or fail

raiseExc m
Signature: m:Message -> '?6747
Type parameters: '?6747

Raise exception with message m

three
Signature: BigRational

Constant 3

toMultipleOf n d
Signature: n:BigRational -> d:BigRational -> BigRational

Convert n to a multiple of d. Raises an CannotDivideByZero message exception when d is zero.

toMultipleOfCont succ fail d n
Signature: succ:(BigRational -> '?6760) -> fail:(Message -> '?6760) -> d:BigRational -> n:BigRational -> '?6760
Type parameters: '?6760

Convert n to a multiple of d. Passes an CannotDivideByZero message to fail when d is zero.

toString v
Signature: v:BigRational -> string

Convert a bigrational to a string

tryParse s
Signature: s:string -> BigRational option

Try to parse a string and return None if it fails otherwise Some bigrational

two
Signature: BigRational

Constant 2

zero
Signature: BigRational

Constant 0

Active patterns

Active patternDescription
( |Mult|Div|Add|Subtr| ) op
Signature: op:(BigRational -> BigRational -> BigRational) -> Choice<unit,unit,unit,unit>

Match an operator op to either multiplication, division, addition or subtraction.
Raises a CannotMatchOperator message exception when no match.

CompiledName: |Mult|Div|Add|Subtr|

Fork me on GitHub