<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym18_1_1459628064933_4760">Hi everyone,</div><div id="yui_3_16_0_ym18_1_1459628064933_4838"><br></div><div id="yui_3_16_0_ym18_1_1459628064933_4853">When trying to generate some unique integer I get some strange behavior.</div><div dir="ltr" id="yui_3_16_0_ym18_1_1459628064933_4991">I'm currently running on a VM with only one core.<br></div><div id="yui_3_16_0_ym18_1_1459628064933_4907"><br></div><font id="yui_3_16_0_ym18_1_1459628064933_4982" size="2">Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:10] [kernel-poll:false]<br id="yui_3_16_0_ym18_1_1459628064933_4899"></font><div id="yui_3_16_0_ym18_1_1459628064933_4981"><font size="2"><br></font></div><div id="yui_3_16_0_ym18_1_1459628064933_4908"><font size="2">Eshell V7.3 (abort with ^G)</font></div><font id="yui_3_16_0_ym18_1_1459628064933_5086" size="2">1> [erlang:unique_integer([positive]) || _ <- lists:seq(1, 15)]. <br id="yui_3_16_0_ym18_1_1459628064933_4902">[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30]<br id="yui_3_16_0_ym18_1_1459628064933_4903">2> <br id="yui_3_16_0_ym18_1_1459628064933_4904"></font><div id="yui_3_16_0_ym18_1_1459628064933_4909" dir="ltr"><br></div><div id="yui_3_16_0_ym18_1_1459628064933_5254" dir="ltr">Why does the step of the unique integer is 2 ? What about the odd values ?<br></div><div id="yui_3_16_0_ym18_1_1459628064933_5255" dir="ltr"><br></div><div dir="ltr" id="yui_3_16_0_ym18_1_1459628064933_4725">My second question is about the depth of this integer. I read <span id="yui_3_16_0_ym18_1_1459628064933_5097">on the documentation 2⁶⁴ - 1.</span></div><div id="yui_3_16_0_ym18_1_1459628064933_5098" dir="ltr"><span id="yui_3_16_0_ym18_1_1459628064933_5097">So i could parse those values in a 64 bits binary integer, right ?</span></div><div id="yui_3_16_0_ym18_1_1459628064933_5168" dir="ltr"><br><span id="yui_3_16_0_ym18_1_1459628064933_5097"></span></div><div id="yui_3_16_0_ym18_1_1459628064933_5169" dir="ltr"><font size="2"><span id="yui_3_16_0_ym18_1_1459628064933_5097">A = erlang:unique_integer([positive]).</span></font></div><div id="yui_3_16_0_ym18_1_1459628064933_5177" dir="ltr"><font size="2"><span id="yui_3_16_0_ym18_1_1459628064933_5097">B = <<A:64/integer>>.<br></span></font></div><div id="yui_3_16_0_ym18_1_1459628064933_5136" dir="ltr"><br></div><div id="yui_3_16_0_ym18_1_1459628064933_5316" dir="ltr">Thanks.</div><div id="yui_3_16_0_ym18_1_1459628064933_5317" dir="ltr"><br><span id="yui_3_16_0_ym18_1_1459628064933_5097"></span></div><div id="yui_3_16_0_ym18_1_1459628064933_5113" dir="ltr"><span id="yui_3_16_0_ym18_1_1459628064933_5097"><br></span></div></div></body></html>