Difference between revisions of "Code Snippet: Random Fractions"
From Coder Merlin
(Created page with "= Generate a Random Fraction = == Swift == <syntaxhighlight lang="swift"> // Generate a fraction and print the result let fraction = Float.random(in: 0 ..< 1) print(fraction)...") |
Nerdofcode (talk | contribs) (Added Perl entry for random floats) |
||
Line 9: | Line 9: | ||
== Python == | == Python == | ||
== Perl == | |||
<syntaxhighlight lang="perl"> | |||
print rand(1), "\n"; | |||
</syntaxhighlight> |