Ruby 4.1.0dev (2026-12-06 revision 6b501f5444cf675f4a654bda46c812e2c1df9fb8)
integer.h File Reference

(6b501f5444cf675f4a654bda46c812e2c1df9fb8)

This module provides functions for working with arbitrary-sized integers. More...

#include "prism/compiler/inline.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for integer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pm_integer_t
 A structure represents an arbitrary-sized integer. More...

Functions

static PRISM_INLINE const uint32_t * pm_integer_words (const pm_integer_t *integer, uint32_t *length)
 Return the words of an integer, least significant first.
static PRISM_INLINE uint64_t pm_integer_uint64_value (const pm_integer_t *integer)
 Return the magnitude of an integer whose length is at most 2, which always fits in a uint64_t.

Detailed Description

This module provides functions for working with arbitrary-sized integers.

Definition in file integer.h.

Function Documentation

◆ pm_integer_uint64_value()

PRISM_INLINE uint64_t pm_integer_uint64_value ( const pm_integer_t * integer)
static

Return the magnitude of an integer whose length is at most 2, which always fits in a uint64_t.

Parameters
integerThe integer to read, whose length must be at most 2.
Returns
The magnitude of the integer.

Definition at line 75 of file integer.h.

◆ pm_integer_words()

PRISM_INLINE const uint32_t * pm_integer_words ( const pm_integer_t * integer,
uint32_t * length )
static

Return the words of an integer, least significant first.

Parameters
integerThe integer to read.
lengthSet to the number of words returned, which is 0 for zero.
Returns
A pointer to the words, valid for as long as the integer is.

Definition at line 57 of file integer.h.