Packages
mmath
0.2.13
0.2.26
0.2.25
0.2.24
0.2.23
0.2.22
0.2.21
0.2.20
0.2.19
0.2.18
0.2.17
0.2.16
0.2.15
0.2.14
0.2.13
0.2.12
0.2.11
0.2.10
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.2.0-alpha9
0.2.0-alpha8
0.2.0-alpha7
0.2.0-alpha6
0.2.0-alpha5
0.2.0-alpha4
0.2.0-alpha3
0.2.0-alpha2
0.2.0-alpha10
0.2.0-alpha1
0.2.0-alpha
0.1.17-alpha
0.1.16
0.1.15
0.1.14
0.1.13
0.1.11
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
math library for metric sequences and binary arrays.
Current section
Files
Jump to
Current section
Files
include/mmath.hrl
%% Those two must match!
%% Number of bits for an integer value, 56 bit is a sweetspot where it it not
%% yet converted in a big int but still byte alligned for binary conversion
-define(BITS, 56).
%% The type of data we store.
-define(INT_TYPE, signed-integer).
%% The size of the type field
-define(TYPE_SIZE, 8).
%% The size of exponent field for floating point decimals
-define(DEC_EXP_SIZE, 8).
%% The size of coefficient field for floating point decimals
-define(DEC_COEF_SIZE, 48).
%% Value types defined so far.
%% this field does not contain a value
-define(NONE, 0).
%% this field does contain an integer value
-define(INT, 1).
%% Type used by floating point decimal using base 10
-define(DEC, 2).
%% Decimal number precision (number of kept digits)
-define(DEC_PRECISION, 14).
%% Point data size
-define(DATA_SIZE, ((?BITS + ?TYPE_SIZE) div 8)).
%% realized (expanded) data size
-define(RDATA_SIZE, 16).
-define(B2L(B), mmath_bin:to_list(B)).
-define(L2B(L), mmath_bin:from_list(L)).