- Building:
rebar3 compile
- C NIF Documentation:
doxygen
(requires Doxygen 1.9.1 or later) - Erlang Documentation:
rebar3 edoc
- Testing:
rebar3 ct
- Execution speed benchmark: execute
rebar3 shell
and runsfmt_tests:test_speed()
andsfmt_pure_tests:test_speed()
- Cleaning up:
rebar3 clean
- Since 14.0, erlang.mk and mix.exs are removed. Use rebar3 to build.
- erlang.mk is updated to stop using
-lerl_interface
. This is required for successfully build in OTP 23.
See Security notice regarding the PHP mt_seed() vulnerability
in the README.md.
- From 0.13.0
- See Issue #23 at #23
- On
uniform/1
anduniform_s/2
- This will enforce the probability values for all possible numbers showing up in the random number sequence of X ranged in
1 <= X <= N
are equal with each other
- 0.12.8 and older versions had a bug of possibly mixing up floats and integers when sfmt:uniform/0 and sfmt:uniform/1 are called in sequence
- From 0.13.0, float values are no longer precomputed and generated from 32-bit integers of SFMT output each time.
uniform/0
anduniform_s/1
are affected - Float NIFs are no longer available from 0.13.0
uniform/0
anduniform_s/1
outputX
range:0.0 < X < 1.0
(from 0.12.0)- This change fixes the scaling bug on
uniform/1
,uniform_s/2
- Thx @timCF on GitHub for pointing this out
sfmt_pure:seed0/0
is fixed to be consistent withsfmt_seed0/0
(from 0.12.0)
- Based on the contribution from Michael Chmielewski (from 0.10.1)
- Package name on hex.pm: sfmt
- hexdocs.pm supported (from 0.12.8)
- All atoms defined inside the NIF code are removed (from 0.10.0)
- if
enif_alloc()
fails,enif_make_badarg()
is called instead of returningerror_sfmt_nomem
(from 0.10.0)
- Common Test source included under
test/
(from 0.10.0)
- Rebar dependency removed, now uses erlang.mk (from 0.10.0)
- Uses erlang.mk NIF support (from 0.10.0)
- Pure Erlang SFMT module now added as working code by request (from 0.8.0_RELEASE)
- The old
seed/1
function calledinit_gen_rand/1
(up to 0.8.0_RELEASE) - The internal state generated by
init_gen_rand/1
is predictable, especially when the value of the 1st element of the state list is very close to the given seed value. (Michael Gebetsroither discovered this behavior) - The new
seed/1
function callsinit_by_list32/1
(from 0.8.1_RELEASE) and the seed is given as[integer()]
, to reduce predictability of the 1st element of the state list.
- MSC/BORLANDC compilation flags removed (from 0.9.1_BETA)
- C NIFs based on SFMT 1.3.3 added (from 0.3.0_RELEASE)
- The version number of this NIF is 101 (see
NIF_LOAD_INFO
macro value)
- asn1 application now starts before starting up public_key application on
support/getrebar
(from 0.9.1_BETA) gen_rand_all/1
is now properly applied insfmt_pure
module whengen_rand32/1
was first invoked (from 0.8.2_RELEASE)- Catched up with the latest rebar configuration file (from 0.7.0_RELEASE)
- Dynamically building ebin/sfmt.app (from 0.7.0_RELEASE)
- PDIC_SEED now named differently for each period (bugfix, from 0.5.2_RELEASE)
- Wichmann-Hill 2006 RNG code is removed
- netpbm test code is removed
- Speedup by NIF: ~40 times faster than the pure Erlang code (when fully inline-optimized (see rebar.config))
- For the pure-Erlang code: writing
++
(append) operators by ring buffer loops (as a pair of lists consuming the head elements, and the corresponding accumulators) made the code ~50% faster; the pure Erlang code available underreference_texts/
gen_rand32/1
,gen_rand32_max/2
, andgen_rand_float/1
use Erlang lists (Dan Gudmudsson showed the list version is faster)- SSE2 code and options in sfmt-extstate were removed due to causing crash of Erlang BEAM (and even if the SSE2 code was enabled the performance increase would be minimal)