JavaScript-QuickJS
view release on metacpan or search on metacpan
easyxs/README.md view on Meta::CPAN
## SV âTypingâ
Perl scalars are supposed to be âuntypedâ, at least insofar as
strings/numbers. When conversing with other languages, though, or
serializing itâs usually helpful to break things down in greater
detail.
EasyXS defines an `exs_sv_type` macro that takes an SV as argument
and returns a member of `enum exs_sv_type_e` (typedefâd as just
`exs_sv_type_e`; see `easyxs_scalar.h` for values). The logic is compatible
with the serialization logic formulated during Perl 5.36âs development cycle.
## SV/Number Conversion
### `UV* exs_SvUV(SV* sv)`
Like `SvUV`, but if the SVâs content canât be a UV
(e.g., the IV is negative, or the string has non-numeric characters)
an exception is thrown.
## SV/String Conversion
quickjs/libbf.c view on Meta::CPAN
bf_mul(Q, Q, &Q2, prec, BF_RNDN);
bf_delete(&Q2);
if (need_g)
bf_mul(G, G, &G2, prec, BF_RNDN);
bf_delete(&G2);
}
}
/* compute Pi with faithful rounding at precision 'prec' using the
Chudnovsky formula */
static void bf_const_pi_internal(bf_t *Q, limb_t prec)
{
bf_context_t *s = Q->ctx;
int64_t n, prec1;
bf_t P, G;
/* number of serie terms */
n = prec / CHUD_BITS_PER_TERM + 1;
/* XXX: precision analysis */
prec1 = prec + 32;
( run in 1.715 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )