Skip to content

Commit

Permalink
random:uniform don't take no floats, truncate those dirty floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin Torres committed May 20, 2009
1 parent 8f39b27 commit db5356d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion uuid.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
-import(random). -import(random).


v4() -> v4() ->
v4(random:uniform(math:pow(2, 48)) - 1, random:uniform(math:pow(2, 12)) - 1, random:uniform(math:pow(2, 32)) - 1, random:uniform(math:pow(2, 30)) - 1). v4(random:uniform(trunc(math:pow(2, 48))) - 1, random:uniform(trunc(math:pow(2, 12))) - 1, random:uniform(trunc(math:pow(2, 32))) - 1, random:uniform(trunc(math:pow(2, 30))) - 1).
v4(R1, R2, R3, R4) -> v4(R1, R2, R3, R4) ->
<<R1:48, 4:4, R2:12, 2:2, R3:32, R4: 30>>. <<R1:48, 4:4, R2:12, 2:2, R3:32, R4: 30>>.
to_string(U) -> to_string(U) ->
Expand Down

0 comments on commit db5356d

Please sign in to comment.