38 if (
d >= (
double)INT64_MIN &&
d <= (
double)INT64_MAX) {
39 int64_t ii = (int64_t)
d;
40 if ((
double)ii ==
d) {
50 const char *
s =
v.s ?
v.s :
"";
52 while (*
p ==
' ' || *
p ==
'\t' || *
p ==
'\r' || *
p ==
'\n')
56 double dval = strtod(
p, &endp);
57 while (endp && (*endp ==
' ' || *endp ==
'\t' || *endp ==
'\r' || *endp ==
'\n'))
59 if (!endp || *endp !=
'\0') {
62 long long parsed = strtoll(
p, &endp, 10);
63 while (endp && (*endp ==
' ' || *endp ==
'\t' || *endp ==
'\r' || *endp ==
'\n'))
65 if (endp && *endp ==
'\0') {
72 if (dval >= (
double)INT64_MIN && dval <= (
double)INT64_MAX) {
73 int64_t ii = (int64_t)dval;
74 if ((
double)ii == dval) {
Tagged union representing a Fun value.
push_value(vm, make_int(0))
void free_value(Value v)
Free dynamic storage owned by a Value.
Value make_float(double v)
Construct a Value representing a double-precision float.
Value make_int(int64_t v)
Construct a Value representing a 64-bit integer.
static Value pop_value(VM *vm)
Pop a Value from the VM operand stack.