Ruby 4.1.0dev (2026-11-05 revision 15d19e341cedf69b35a840d21328374927e50ec9)
double.h
1/*
2 * This module provides a function for parsing the values of float literals.
3 */
4#ifndef PRISM_INTERNAL_DOUBLE_H
5#define PRISM_INTERNAL_DOUBLE_H
6
7#include <stdbool.h>
8#include <stdint.h>
9
10/*
11 * Parse a decimal float literal into the nearest double, rounding ties to even.
12 * This assumes that the format of the literal has already been validated. It
13 * may start with a plus sign, which unary plus on a numeric literal leaves in
14 * its token. Underscores between digits are skipped. Sets out_of_range when the
15 * literal is nonzero but its value rounds to zero or to infinity.
16 */
17double pm_double_parse(const uint8_t *start, const uint8_t *end, bool *out_of_range);
18
19#endif
C99 shim for <stdbool.h>