Permalink
Browse files

random:uniform don't take no floats, truncate those dirty floats

  • Loading branch information...
1 parent 8f39b27 commit db5356d60fe707e4ae0cc4ecf9931df0f2f968b4 Devin Torres committed May 20, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 uuid.erl
View
@@ -33,7 +33,7 @@
-import(random).
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) ->
<<R1:48, 4:4, R2:12, 2:2, R3:32, R4: 30>>.
to_string(U) ->

0 comments on commit db5356d

Please sign in to comment.