Skip to content

Commit a1cf611

Browse files
committed
Fix random without a limit always returning 0
1 parent 0dd6543 commit a1cf611

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,8 +1079,8 @@ namespace Sass {
10791079
}
10801080
else {
10811081
uniform_real_distribution<> distributor(0, 1);
1082-
uint_fast32_t distributed = static_cast<uint_fast32_t>(distributor(rand));
1083-
return new (ctx.mem) Number(pstate, trunc(distributed));
1082+
double distributed = static_cast<double>(distributor(rand));
1083+
return new (ctx.mem) Number(pstate, distributed);
10841084
}
10851085
}
10861086

0 commit comments

Comments
 (0)