lexicon-fractional-index

an implementation of fractional index for lexicon.

fractional-index
Download zip
Author
Version
0.0.4
License
Apache-2.0
Last updated
8 months ago
Downloads
22

#lexicon-fractional-index

an implementation of fractional index for lexicon.

moon add tiye/lexicon-fractional-index

{ "path": "tiye/lexicon-fractional-index", "alias": "lexicon" }

key_between(a, b) // generated key between a and b
n_key_between(a, b, n) // n generated keys between a and b

#License

Apache 2.0

KeyError

pub suberror KeyError String

common error structure of lexicon order key
impl Show for KeyError

float64_approx

fn float64_approx(key : String) -> Double raise KeyError

float64_approx converts a key as generated by key_between() to a float64. Because the range of keys is far larger than float64 can represent accurately, this is necessarily approximate. But for many use cases it should be, as they say, close enough for jazz.

key_between

fn key_between(a : String?, b : String?) -> String raise KeyError

key_between returns a key that sorts lexicographically between a and b. Either a or b can be empty strings. If a is empty it indicates smallest key, If b is empty it indicates largest key. b must be empty string or > a.

n_keys_between

fn n_keys_between(a : String?, b : String?, n : Int) -> Array[String] raise KeyError

n_keys_between returns n keys between a and b that sorts lexicographically. Either a or b can be empty strings. If a is empty it indicates smallest key, If b is empty it indicates largest key. b must be empty string or > a.

pow

fn pow(x : Int, exp : Int) -> Int

powf

fn powf(x : Double, exp : Int) -> Double

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io