Ruby 4.1.0dev (2026-11-16 revision 67814cf9b0f3a4bad6f7369b0c8e6fc69220de64)
pm_integer_t Struct Reference

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

#include <integer.h>

Data Fields

uint32_t length
 The number of words in the magnitude, with no leading zero words.
bool negative
 Whether or not the integer is negative.
union { 
   uint32_t   value [2] 
 The words of an integer whose length is at most 2. More...
   uint32_t *   values 
 The words of an integer whose length is greater than 2. More...
} words
 The words of the magnitude.

Detailed Description

A structure represents an arbitrary-sized integer.

The magnitude is stored as 32-bit words, least significant first.

Definition at line 19 of file integer.h.

Field Documentation

◆ length

uint32_t pm_integer_t::length

The number of words in the magnitude, with no leading zero words.

Zero has no words, so a zeroed pm_integer_t is always positive zero.

Definition at line 24 of file integer.h.

Referenced by pm_integer_words().

◆ negative

bool pm_integer_t::negative

Whether or not the integer is negative.

Definition at line 29 of file integer.h.

◆ value

uint32_t pm_integer_t::value[2]

The words of an integer whose length is at most 2.

Words past the length are zero.

Definition at line 40 of file integer.h.

Referenced by pm_integer_uint64_value(), and pm_integer_words().

◆ values

uint32_t* pm_integer_t::values

The words of an integer whose length is greater than 2.

Definition at line 45 of file integer.h.

Referenced by pm_integer_words().

◆ [union]

union { ... } pm_integer_t::words

The words of the magnitude.

Read them through pm_integer_words or pm_integer_uint64_value rather than directly.

Referenced by pm_integer_uint64_value(), and pm_integer_words().


The documentation for this struct was generated from the following file: