tensort-1.0.1.0: Tunable sorting for responsive robustness and beyond
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Tensort.Utils.LogNat

Description

This module provides functions for calculating the natural logarithms in a way useful for creating logarithmic Bytesizes

Synopsis

Documentation

getLnBytesize :: Sortable -> Int Source #

Calculate a suitable logarithmic Bytesize from a Sortable

Examples

Expand
>>> getLnBytesize (SortBit [1 .. 27])
4
>>> getLnBytesize  (SortRec [(1, 16), (5, 23), (2, 4) ,(3, 8), (0, 15) , (4, 42)])
2

getLn :: Int -> Int Source #

Calculate a the natural logarithm of an Int, rounded up to the nearest integer

| ==== Examples >>> getLn 27 4