Logo GenPRES

BigRational Module

Parses a text of numbers separated by semicolons into BigRationals and pairs the first values of two arrays as options.

Functions and values

Function or value Description

toBrs s

Full Usage: toBrs s

Parameters:
    s : string

Returns: RationalX array

Parses a text of numbers separated by ; into an array of BigRationals.

A part that does not parse as a number is skipped.

s : string
Returns: RationalX array
Example

 let brs = toBrs "1.0;2.0;3.0"
 // returns [|1N; 2N; 3N|]
 let brs = toBrs "1.0;2.0;3.0;abc"
 // returns [|1N; 2N; 3N|]
val brs: obj

tupleBrOpt brs1 brs2

Full Usage: tupleBrOpt brs1 brs2

Parameters:
    brs1 : 'a array
    brs2 : 'b array

Returns: 'a option * 'b option
Type parameters: 'a, 'b

Returns the first value of each of two arrays as a pair of options; None for an empty array.

brs1 : 'a array
brs2 : 'b array
Returns: 'a option * 'b option
Example

 let brs1 = [|1N|]
 let brs2 = [|4N|]
 tupleBrOpt brs1 brs2
 // returns (Some 1N, Some 4N)
 let brs1 = [|1N|]
 let brs2 = [||]
 tupleBrOpt brs1 brs2
 // returns (Some 1N, None)
val brs1: obj array
val brs2: obj array
val brs2: 'a array

Type something to start searching.