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.
20 lines
432 B
20 lines
432 B
name: duk_require_number
|
|
|
|
proto: |
|
|
duk_double_t duk_require_number(duk_context *ctx, duk_idx_t idx);
|
|
|
|
stack: |
|
|
[ ... val! ... ]
|
|
|
|
summary: |
|
|
<p>Like <code><a href="#duk_get_number">duk_get_number()</a></code>,
|
|
but throws an error if the value at <code>idx</code> is not a number
|
|
or if the index is invalid.</p>
|
|
|
|
example: |
|
|
printf("value: %lf\n", (double) duk_require_number(ctx, -3));
|
|
|
|
tags:
|
|
- stack
|
|
|
|
introduced: 1.0.0
|
|
|