tensort-1.0.1.4: 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 #

Calculates a suitable logarithmic Bytesize for a given Sortable list.

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 #

Calculates the natural logarithm of an integer, rounded up to the nearest integer.

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