mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
308 B
18 lines
308 B
name: duk_random
|
|
|
|
proto: |
|
|
duk_double_t duk_random(duk_context *ctx);
|
|
|
|
summary: |
|
|
<p>C API counterpart to <code>Math.random()</code>; returns a
|
|
random IEEE double in the range [0,1[.</p>
|
|
|
|
example: |
|
|
if (duk_random(ctx) <= 0.01) {
|
|
printf("surprise!\n");
|
|
}
|
|
|
|
tags:
|
|
- random
|
|
|
|
introduced: 2.3.0
|
|
|