w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

utilnumber.c File Reference
#include <math.h>
#include <stdio.h>
#include "utilnumber.h"
Include dependency graph for utilnumber.c:

Go to the source code of this file.

Classes

struct  ieee_double
 
struct  ieee_float
 

Macros

#define string_scan_sign(s, c, sign)   _scan_sign(c, sign, *++s)
 
#define string_scan_integer(s, c, number)   _scan_integer(c, number, *++s)
 
#define string_scan_radix(s, c, number, radix)   _scan_radix(c, number, radix, *++s)
 
#define string_read_integer(s, c, number)   _read_integer(c, number, *++s)
 
#define string_read_radix(s, c, number, radix)   _read_radix(c, number, radix, *++s)
 
#define roman1000(c)   (c == 'M' || c == 'm')
 
#define roman500(c)   (c == 'D' || c == 'd')
 
#define roman100(c)   (c == 'C' || c == 'c')
 
#define roman50(c)   (c == 'L' || c == 'l')
 
#define roman10(c)   (c == 'X' || c == 'x')
 
#define roman5(c)   (c == 'V' || c == 'v')
 
#define roman1(c)   (c == 'I' || c == 'i')
 
#define roman100s(p)   (roman100(*p) ? (100 + ((++p, roman100(*p)) ? (100 + ((++p, roman100(*p)) ? (++p, 100) : 0)) : 0)) : 0)
 
#define roman10s(p)   (roman10(*p) ? (10 + ((++p, roman10(*p)) ? (10 + ((++p, roman10(*p)) ? (++p, 10) : 0)) : 0)) : 0)
 
#define roman1s(p)   (roman1(*p) ? (1 + ((++p, roman1(*p)) ? (1 + ((++p, roman1(*p)) ? (++p, 1) : 0)) : 0)) : 0)
 
#define end_of_integer_buffer(integer_buffer)   (integer_buffer + MAX_INTEGER_DIGITS - 1)
 
#define number_printrev_signed(p, number, quotient)
 
#define number_printrev_unsigned(p, number, quotient)
 
#define SINTTYPE_AS_STRING(inttype, number, ibuf, psize)
 
#define UINTTYPE_AS_STRING(inttype, number, ibuf, psize)
 
#define number_printrev_signed_radix_uc(p, number, radix, quotient)
 
#define number_printrev_signed_radix_lc(p, number, radix, quotient)
 
#define number_printrev_signed_radix(p, number, radix, quotient, uc)
 
#define number_printrev_unsigned_radix_uc(p, number, radix, quotient)
 
#define number_printrev_unsigned_radix_lc(p, number, radix, quotient)
 
#define number_printrev_unsigned_radix(p, number, radix, quotient, uc)
 
#define SINTTYPE_AS_RADIX(inttype, number, radix, uc, ibuf, psize)
 
#define UINTTYPE_AS_RADIX(inttype, number, radix, uc, ibuf, psize)
 
#define string_scan_alpha(s, c, number, radix)    for (number = 0, c = *s; (c = base26_value(c)) > 0; number = number * radix + c, c = *++s)
 
#define number_printrev_unsigned_alpha_uc(p, number, radix, quotient)
 
#define number_printrev_unsigned_alpha_lc(p, number, radix, quotient)
 
#define UINTTYPE_AS_ALPHA(inttype, number, uc, ibuf, psize)
 
#define string_scan_alphan(s, c, number, radix)
 
#define number_print_alphan_uc(p, e, c, number, radix)
 
#define number_print_alphan_lc(p, e, c, number, radix)
 
#define UINTTYPE_AS_ALPHAN(inttype, number, uc, ibuf, size, psize)
 
#define base_roman_uc_alphabet   "MDCLXVI"
 
#define base_roman_lc_alphabet   "mdclxvi"
 
#define BINARY_MODF   1
 
#define NOT_A_NUMBER_STRING   "NaN"
 
#define INFINITY_STRING   "INF"
 
#define SIGNED_INFINITY   1
 
#define SIGNED_ZERO   0
 
#define SIGNED_NOT_A_NUMBER   0
 
#define RADIX_CHAR   '.'
 
#define IEEE_DOUBLE_BIAS   1023
 
#define IEEE_DOUBLE_MIN_EXPONENT   -1023
 
#define IEEE_DOUBLE_MAX_EXPONENT   (0x7ff - IEEE_DOUBLE_BIAS)
 
#define IEEE_FLOAT_BIAS   127
 
#define IEEE_FLOAT_MIN_EXPONENT   -127
 
#define IEEE_FLOAT_MAX_EXPONENT   (0xff - IEEE_FLOAT_BIAS)
 
#define ieee_double_fraction(i)   (i & 0x000fffffffffffffull)
 
#define ieee_double_exponent(i)   ((0x7ff & (i >> 52)) - IEEE_DOUBLE_BIAS)
 
#define ieee_double_init(ieee_number, number)
 
#define ieee_float_fraction(i)   (i & 0x007fffff)
 
#define ieee_float_exponent(i)   ((0xff & (i >> 23)) - IEEE_FLOAT_BIAS)
 
#define ieee_float_init(ieee_number, number)
 
#define ieee_double_is_zero(ieee_number)   (ieee_number.number == 0)
 
#define ieee_double_too_small(ieee_number)   (ieee_number.exponent == 0 && ieee_number.fraction != 0)
 
#define ieee_float_is_zero(ieee_number)   (ieee_number.number == 0)
 
#define ieee_float_too_small(ieee_number)   (ieee_number.exponent == 0 && ieee_number.fraction != 0)
 
#define ieee_double_zero_string(ieee_number)   (SIGNED_ZERO && ieee_number.sign ? "-0" : "0")
 
#define ieee_double_infinity_string(ieee_number)   (SIGNED_INFINITY && ieee_number.sign ? "-" INFINITY_STRING : INFINITY_STRING)
 
#define ieee_float_zero_string   ieee_double_zero_string
 
#define ieee_float_infinity_string   ieee_double_infinity_string
 
#define ieee_double_special_case(ieee_number)   (ieee_number.exponent == IEEE_DOUBLE_MAX_EXPONENT)
 
#define ieee_double_special_string(ieee_number)   (ieee_number.fraction ? NOT_A_NUMBER_STRING : ieee_double_infinity_string(ieee_number))
 
#define ieee_float_special_case(ieee_number)   (ieee_number.exponent == IEEE_FLOAT_MAX_EXPONENT)
 
#define ieee_float_special_string(ieee_number)   (ieee_number.fraction ? NOT_A_NUMBER_STRING : ieee_float_infinity_string(ieee_number))
 
#define ieee_double_exponent10(ieee_number)   ((int)floor(log10(ieee_number.number)) + 1)
 
#define ieee_float_exponent10(ieee_number)   ((int)floorf(log10f(ieee_number.number)) + 1)
 
#define ieee_double_exp10(ieee_number, exponent10)
 
#define ieee_float_exp10(ieee_number, exponent10)
 
#define ieee_double_denormalize(ieee_number)
 
#define ieee_float_denormalize(ieee_number)
 
#define ieee_double_binary_fraction(ieee_number)
 
#define ieee_float_binary_fraction(ieee_number)
 
#define ieee_double_decimal(ieee_number, exponent10, digits, p)    ieee_number_decimal(ieee_double_binary_fraction, ieee_number, exponent10, digits, p)
 
#define ieee_float_decimal(ieee_number, exponent10, digits, p)    ieee_number_decimal(ieee_float_binary_fraction, ieee_number, exponent10, digits, p)
 
#define ieee_number_decimal(method, ieee_number, exponent10, digits, p)
 
#define ieee_double_half(ieee_number)   (ieee_number.fraction & (1ull<<55))
 
#define ieee_float_half(ieee_number)   (ieee_number.fraction & (1<<26))
 
#define buffer_ceil(s, p, sign)
 
#define buffer_remove_trailing_zeros(s, p, sign)
 
#define ieee_double_round(ieee_number, exponent10, s, p)
 
#define ieee_float_round(ieee_number, exponent10, s, p)
 
#define ieee_copy_special_string(nbuf, special, p, _p)
 
#define ieee_copy_special_string_re(nbuf, special, p, _p, r, e)
 
#define string_scan_decimal(s, c, number)   _scan_decimal(c, number, *++s)
 
#define string_scan_fraction(s, c, number, exponent10)   _scan_fraction(c, number, exponent10, *++s)
 
#define string_scan_exponent10(s, c, exponent10)   _scan_exponent10(c, exponent10, *++s)
 

Typedefs

typedef struct ieee_double ieee_double
 
typedef struct ieee_float ieee_float
 

Functions

const char * string_to_int32 (const char *s, int32_t *number)
 
const char * string_to_slong (const char *s, long *number)
 
const char * string_to_int64 (const char *s, int64_t *number)
 
const char * string_to_uint32 (const char *s, uint32_t *number)
 
const char * string_to_ulong (const char *s, unsigned long *number)
 
const char * string_to_usize (const char *s, size_t *number)
 
const char * string_to_uint64 (const char *s, uint64_t *number)
 
const char * radix_to_int32 (const char *s, int32_t *number, int radix)
 
const char * radix_to_slong (const char *s, long *number, int radix)
 
const char * radix_to_int64 (const char *s, int64_t *number, int radix)
 
const char * radix_to_uint32 (const char *s, uint32_t *number, int radix)
 
const char * radix_to_ulong (const char *s, unsigned long *number, int radix)
 
const char * radix_to_usize (const char *s, size_t *number, int radix)
 
const char * radix_to_uint64 (const char *s, uint64_t *number, int radix)
 
const char * roman_to_uint16 (const char *s, uint16_t *number)
 
char * int32_as_string (int32_t number, char ibuf[65], size_t *psize)
 
char * slong_as_string (long number, char ibuf[65], size_t *psize)
 
char * int64_as_string (int64_t number, char ibuf[65], size_t *psize)
 
char * uint32_as_string (uint32_t number, char ibuf[65], size_t *psize)
 
char * ulong_as_string (unsigned long number, char ibuf[65], size_t *psize)
 
char * usize_as_string (size_t number, char ibuf[65], size_t *psize)
 
char * uint64_as_string (uint64_t number, char ibuf[65], size_t *psize)
 
char * int32_as_radix (int32_t number, int radix, int uc, char ibuf[65], size_t *psize)
 
char * slong_as_radix (long number, int radix, int uc, char ibuf[65], size_t *psize)
 
char * int64_as_radix (int64_t number, int radix, int uc, char ibuf[65], size_t *psize)
 
char * uint32_as_radix (uint32_t number, int radix, int uc, char ibuf[65], size_t *psize)
 
char * ulong_as_radix (unsigned long number, int radix, int uc, char ibuf[65], size_t *psize)
 
char * usize_as_radix (size_t number, int radix, int uc, char ibuf[65], size_t *psize)
 
char * uint64_as_radix (uint64_t number, int radix, int uc, char ibuf[65], size_t *psize)
 
const char * alpha_to_uint32 (const char *s, uint32_t *number)
 
const char * alpha_to_ulong (const char *s, unsigned long *number)
 
const char * alpha_to_usize (const char *s, size_t *number)
 
const char * alpha_to_uint64 (const char *s, uint64_t *number)
 
char * uint32_as_alpha (uint32_t number, int uc, char ibuf[65], size_t *psize)
 
char * ulong_as_alpha (unsigned long number, int uc, char ibuf[65], size_t *psize)
 
char * usize_as_alpha (size_t number, int uc, char ibuf[65], size_t *psize)
 
char * uint64_as_alpha (uint64_t number, int uc, char ibuf[65], size_t *psize)
 
const char * alphan_to_uint16 (const char *s, uint16_t *number)
 
char * uint16_as_alphan (uint16_t number, int uc, char ibuf[], size_t size, size_t *psize)
 
char * uint16_as_roman (uint16_t number, int uc, char ibuf[128], size_t *psize)
 
char * double_as_string (double number, int digits, char nbuf[512], size_t *psize)
 
char * float_as_string (float number, int digits, char nbuf[512], size_t *psize)
 
const char * string_to_double (const char *s, double *number)
 
const char * string_to_float (const char *s, float *number)
 
const char * convert_to_double (const char *s, double *number)
 
const char * convert_to_float (const char *s, float *number)
 
size_t bytes_to_hex_lc (const void *input, size_t size, unsigned char *output)
 
size_t bytes_to_hex_uc (const void *input, size_t size, unsigned char *output)
 
size_t hex_to_bytes (const void *input, size_t size, unsigned char *output)
 
void print_as_hex (const void *input, size_t bytes)
 

Variables

const int base10_lookup []
 
const int base16_lookup []
 
const int base26_lookup []
 
const int base36_lookup []
 
char util_number_buffer [512] = { 0 }
 
const double double_decimal_power10 []
 
const float float_decimal_power10 []
 
const double double_decimal_negpower10 []
 
const float float_decimal_negpower10 []
 

Macro Definition Documentation

◆ base_roman_lc_alphabet

#define base_roman_lc_alphabet   "mdclxvi"

Definition at line 604 of file utilnumber.c.

◆ base_roman_uc_alphabet

#define base_roman_uc_alphabet   "MDCLXVI"

Definition at line 603 of file utilnumber.c.

◆ BINARY_MODF

#define BINARY_MODF   1

Definition at line 643 of file utilnumber.c.

◆ buffer_ceil

#define buffer_ceil (   s,
  p,
  sign 
)
Value:
{ \
while (*--p == '9'); \
if (*p != RADIX_CHAR) ++*p++; \
else { \
char *q; \
for (q = p - 1; ; --q) { \
if (*q < '9') { ++*q; break; } \
*q = '0'; \
if (q == s) \
*--s = '1'; \
else if (sign && q - 1 == s) \
*s = '1', *--s = '-'; \
} \
} \
}
q
Definition: afm2pl.c:2287
#define s
Definition: afcover.h:80
small capitals from c petite p
Definition: afcover.h:72
#define sign(x)
#define RADIX_CHAR
Definition: utilnumber.c:650

Definition at line 924 of file utilnumber.c.

◆ buffer_remove_trailing_zeros

#define buffer_remove_trailing_zeros (   s,
  p,
  sign 
)
Value:
{ \
while (*--p == '0'); \
if (*p != RADIX_CHAR) \
++p; \
else if (!SIGNED_ZERO && sign && p - 2 == s && *(p - 1) == '0') \
p -= 2, *p++ = '0'; \
}
#define SIGNED_ZERO
Definition: utilnumber.c:648

Definition at line 941 of file utilnumber.c.

◆ end_of_integer_buffer

#define end_of_integer_buffer (   integer_buffer)    (integer_buffer + MAX_INTEGER_DIGITS - 1)

Definition at line 299 of file utilnumber.c.

◆ ieee_copy_special_string

#define ieee_copy_special_string (   nbuf,
  special,
  p,
  _p 
)
Value:
for (p = nbuf, _p = special; ; ++p, ++_p) { \
if ((*p = *_p) == '\0') break; \
}
END END END break
Definition: bibtex-3.c:1974
#define special
Definition: devnag.c:330
static char nbuf[100]
Definition: hpcdtoppm.c:135

Definition at line 965 of file utilnumber.c.

◆ ieee_copy_special_string_re

#define ieee_copy_special_string_re (   nbuf,
  special,
  p,
  _p,
  r,
  e 
)
Value:
for (p = nbuf, _p = special; ; ++p, ++_p) { \
if ((*p = *_p) == '\0') { \
if (r != NULL) *r = NULL; \
if (e != NULL) *e = p; \
break; \
} \
}
#define NULL
Definition: ftobjs.h:61
int r
Definition: ppmqvga.c:68
ShellFileEnvironment e
Definition: sh6.c:388

Definition at line 970 of file utilnumber.c.

◆ IEEE_DOUBLE_BIAS

#define IEEE_DOUBLE_BIAS   1023

Definition at line 672 of file utilnumber.c.

◆ ieee_double_binary_fraction

#define ieee_double_binary_fraction (   ieee_number)
Value:
(ieee_number.fraction &= ((1ull<<56) - 1), \
ieee_number.fraction = (ieee_number.fraction << 1) + (ieee_number.fraction << 3), \
ieee_number.fraction >> 56)

Definition at line 867 of file utilnumber.c.

◆ ieee_double_decimal

#define ieee_double_decimal (   ieee_number,
  exponent10,
  digits,
  p 
)     ieee_number_decimal(ieee_double_binary_fraction, ieee_number, exponent10, digits, p)

Definition at line 879 of file utilnumber.c.

◆ ieee_double_denormalize

#define ieee_double_denormalize (   ieee_number)
Value:
(ieee_number.exponent == IEEE_DOUBLE_MIN_EXPONENT ? (++ieee_number.exponent, 0) : (ieee_number.fraction |= (1ull<<52))), \
ieee_number.fraction <<= (ieee_number.exponent + 4)
#define IEEE_DOUBLE_MIN_EXPONENT
Definition: utilnumber.c:673

Definition at line 855 of file utilnumber.c.

◆ ieee_double_exp10

#define ieee_double_exp10 (   ieee_number,
  exponent10 
)
Value:
exponent10 = ieee_double_exponent10(ieee_number); \
if (exponent10 > 0) { \
double_negative_exp10(ieee_number.number, -exponent10); \
ieee_number.fraction = ieee_double_fraction(ieee_number.bits); \
ieee_number.exponent = ieee_double_exponent(ieee_number.bits); \
} else if (exponent10 < 0) { \
double_positive_exp10(ieee_number.number, -exponent10); \
ieee_number.fraction = ieee_double_fraction(ieee_number.bits); \
ieee_number.exponent = ieee_double_exponent(ieee_number.bits); \
}
#define ieee_double_exponent(i)
Definition: utilnumber.c:681
#define ieee_double_exponent10(ieee_number)
Definition: utilnumber.c:824
#define ieee_double_fraction(i)
Definition: utilnumber.c:680

Definition at line 827 of file utilnumber.c.

◆ ieee_double_exponent

#define ieee_double_exponent (   i)    ((0x7ff & (i >> 52)) - IEEE_DOUBLE_BIAS)

Definition at line 681 of file utilnumber.c.

◆ ieee_double_exponent10

#define ieee_double_exponent10 (   ieee_number)    ((int)floor(log10(ieee_number.number)) + 1)

Definition at line 824 of file utilnumber.c.

◆ ieee_double_fraction

#define ieee_double_fraction (   i)    (i & 0x000fffffffffffffull)

Definition at line 680 of file utilnumber.c.

◆ ieee_double_half

#define ieee_double_half (   ieee_number)    (ieee_number.fraction & (1ull<<55))

Definition at line 915 of file utilnumber.c.

◆ ieee_double_infinity_string

#define ieee_double_infinity_string (   ieee_number)    (SIGNED_INFINITY && ieee_number.sign ? "-" INFINITY_STRING : INFINITY_STRING)

Definition at line 703 of file utilnumber.c.

◆ ieee_double_init

#define ieee_double_init (   ieee_number,
  number 
)
Value:
ieee_number.number = number, \
ieee_number.fraction = ieee_double_fraction(ieee_number.bits), \
ieee_number.exponent = ieee_double_exponent(ieee_number.bits)
int number
Definition: t1part.c:207

Definition at line 682 of file utilnumber.c.

◆ ieee_double_is_zero

#define ieee_double_is_zero (   ieee_number)    (ieee_number.number == 0)

Definition at line 696 of file utilnumber.c.

◆ IEEE_DOUBLE_MAX_EXPONENT

#define IEEE_DOUBLE_MAX_EXPONENT   (0x7ff - IEEE_DOUBLE_BIAS)

Definition at line 674 of file utilnumber.c.

◆ IEEE_DOUBLE_MIN_EXPONENT

#define IEEE_DOUBLE_MIN_EXPONENT   -1023

Definition at line 673 of file utilnumber.c.

◆ ieee_double_round

#define ieee_double_round (   ieee_number,
  exponent10,
  s,
  p 
)
Value:
if (exponent10 == 0 && ieee_double_half(ieee_number)) \
{ buffer_ceil(s, p, ieee_number.sign); } \
else \
{ buffer_remove_trailing_zeros(s, p, ieee_number.sign); }
#define buffer_ceil(s, p, sign)
Definition: utilnumber.c:924
#define buffer_remove_trailing_zeros(s, p, sign)
Definition: utilnumber.c:941
#define ieee_double_half(ieee_number)
Definition: utilnumber.c:915

Definition at line 951 of file utilnumber.c.

◆ ieee_double_special_case

#define ieee_double_special_case (   ieee_number)    (ieee_number.exponent == IEEE_DOUBLE_MAX_EXPONENT)

Definition at line 708 of file utilnumber.c.

◆ ieee_double_special_string

#define ieee_double_special_string (   ieee_number)    (ieee_number.fraction ? NOT_A_NUMBER_STRING : ieee_double_infinity_string(ieee_number))

Definition at line 709 of file utilnumber.c.

◆ ieee_double_too_small

#define ieee_double_too_small (   ieee_number)    (ieee_number.exponent == 0 && ieee_number.fraction != 0)

Definition at line 697 of file utilnumber.c.

◆ ieee_double_zero_string

#define ieee_double_zero_string (   ieee_number)    (SIGNED_ZERO && ieee_number.sign ? "-0" : "0")

Definition at line 702 of file utilnumber.c.

◆ IEEE_FLOAT_BIAS

#define IEEE_FLOAT_BIAS   127

Definition at line 676 of file utilnumber.c.

◆ ieee_float_binary_fraction

#define ieee_float_binary_fraction (   ieee_number)
Value:
(ieee_number.fraction &= ((1<<27) - 1), \
ieee_number.fraction = (ieee_number.fraction << 1) + (ieee_number.fraction << 3), \
ieee_number.fraction >> 27)

Definition at line 874 of file utilnumber.c.

◆ ieee_float_decimal

#define ieee_float_decimal (   ieee_number,
  exponent10,
  digits,
  p 
)     ieee_number_decimal(ieee_float_binary_fraction, ieee_number, exponent10, digits, p)

Definition at line 881 of file utilnumber.c.

◆ ieee_float_denormalize

#define ieee_float_denormalize (   ieee_number)
Value:
(ieee_number.exponent == IEEE_FLOAT_MIN_EXPONENT ? (++ieee_number.exponent, 0) : (ieee_number.fraction |= (1<<23))), \
ieee_number.fraction <<= (ieee_number.exponent + 4)
#define IEEE_FLOAT_MIN_EXPONENT
Definition: utilnumber.c:677

Definition at line 861 of file utilnumber.c.

◆ ieee_float_exp10

#define ieee_float_exp10 (   ieee_number,
  exponent10 
)
Value:
exponent10 = ieee_float_exponent10(ieee_number); \
if (exponent10 > 0) { \
float_negative_exp10(ieee_number.number, -exponent10); \
ieee_number.fraction = ieee_float_fraction(ieee_number.bits); \
ieee_number.exponent = ieee_float_exponent(ieee_number.bits); \
} else if (exponent10 < 0) { \
float_positive_exp10(ieee_number.number, -exponent10); \
ieee_number.fraction = ieee_float_fraction(ieee_number.bits); \
ieee_number.exponent = ieee_float_exponent(ieee_number.bits); \
}
#define ieee_float_fraction(i)
Definition: utilnumber.c:687
#define ieee_float_exponent(i)
Definition: utilnumber.c:688
#define ieee_float_exponent10(ieee_number)
Definition: utilnumber.c:825

Definition at line 839 of file utilnumber.c.

◆ ieee_float_exponent

#define ieee_float_exponent (   i)    ((0xff & (i >> 23)) - IEEE_FLOAT_BIAS)

Definition at line 688 of file utilnumber.c.

◆ ieee_float_exponent10

#define ieee_float_exponent10 (   ieee_number)    ((int)floorf(log10f(ieee_number.number)) + 1)

Definition at line 825 of file utilnumber.c.

◆ ieee_float_fraction

#define ieee_float_fraction (   i)    (i & 0x007fffff)

Definition at line 687 of file utilnumber.c.

◆ ieee_float_half

#define ieee_float_half (   ieee_number)    (ieee_number.fraction & (1<<26))

Definition at line 916 of file utilnumber.c.

◆ ieee_float_infinity_string

#define ieee_float_infinity_string   ieee_double_infinity_string

Definition at line 706 of file utilnumber.c.

◆ ieee_float_init

#define ieee_float_init (   ieee_number,
  number 
)
Value:
ieee_number.number = number, \
ieee_number.fraction = ieee_float_fraction(ieee_number.bits), \
ieee_number.exponent = ieee_float_exponent(ieee_number.bits)

Definition at line 689 of file utilnumber.c.

◆ ieee_float_is_zero

#define ieee_float_is_zero (   ieee_number)    (ieee_number.number == 0)

Definition at line 699 of file utilnumber.c.

◆ IEEE_FLOAT_MAX_EXPONENT

#define IEEE_FLOAT_MAX_EXPONENT   (0xff - IEEE_FLOAT_BIAS)

Definition at line 678 of file utilnumber.c.

◆ IEEE_FLOAT_MIN_EXPONENT

#define IEEE_FLOAT_MIN_EXPONENT   -127

Definition at line 677 of file utilnumber.c.

◆ ieee_float_round

#define ieee_float_round (   ieee_number,
  exponent10,
  s,
  p 
)
Value:
if (exponent10 == 0 && ieee_float_half(ieee_number)) \
{ buffer_ceil(s, p, ieee_number.sign); } \
else \
{ buffer_remove_trailing_zeros(s, p, ieee_number.sign); }
#define ieee_float_half(ieee_number)
Definition: utilnumber.c:916

Definition at line 957 of file utilnumber.c.

◆ ieee_float_special_case

#define ieee_float_special_case (   ieee_number)    (ieee_number.exponent == IEEE_FLOAT_MAX_EXPONENT)

Definition at line 711 of file utilnumber.c.

◆ ieee_float_special_string

#define ieee_float_special_string (   ieee_number)    (ieee_number.fraction ? NOT_A_NUMBER_STRING : ieee_float_infinity_string(ieee_number))

Definition at line 712 of file utilnumber.c.

◆ ieee_float_too_small

#define ieee_float_too_small (   ieee_number)    (ieee_number.exponent == 0 && ieee_number.fraction != 0)

Definition at line 700 of file utilnumber.c.

◆ ieee_float_zero_string

#define ieee_float_zero_string   ieee_double_zero_string

Definition at line 705 of file utilnumber.c.

◆ ieee_number_decimal

#define ieee_number_decimal (   method,
  ieee_number,
  exponent10,
  digits,
  p 
)
Value:
ieee_double_denormalize(ieee_number); \
if (ieee_number.sign) *p++ = '-'; \
if (exponent10 <= 0) \
for (*p++ = '0', *p++ = RADIX_CHAR; exponent10 && digits; *p++ = '0', ++exponent10, --digits); \
else \
{ \
do { *p++ = '0' + (char)method(ieee_number); } while (--exponent10); \
*p++ = RADIX_CHAR; \
} \
for ( ; digits && ieee_number.fraction; --digits) \
*p++ = '0' + (char)method(ieee_number)
unsigned digits[12]
Definition: out_routines.c:255
#define ieee_double_denormalize(ieee_number)
Definition: utilnumber.c:855

Definition at line 898 of file utilnumber.c.

◆ INFINITY_STRING

#define INFINITY_STRING   "INF"

Definition at line 646 of file utilnumber.c.

◆ NOT_A_NUMBER_STRING

#define NOT_A_NUMBER_STRING   "NaN"

Definition at line 645 of file utilnumber.c.

◆ number_print_alphan_lc

#define number_print_alphan_lc (   p,
  e,
  c,
  number,
  radix 
)
Value:
for (c = (--number) % radix, number -= c; ; number -= radix) { \
if (number == 0 || p >= e) break; \
}
static int radix
Definition: aptex.h:450
#define c(n)
Definition: gpos-common.c:150
#define base26_lc_alphabet
Definition: utilnumber.h:72

Definition at line 575 of file utilnumber.c.

◆ number_print_alphan_uc

#define number_print_alphan_uc (   p,
  e,
  c,
  number,
  radix 
)
Value:
for (c = (--number) % radix, number -= c; ; number -= radix) { \
if (number == 0 || p >= e) break; \
}
#define base26_uc_alphabet
Definition: utilnumber.h:71

Definition at line 569 of file utilnumber.c.

◆ number_printrev_signed

#define number_printrev_signed (   p,
  number,
  quotient 
)
Value:
do { \
quotient = number; number /= 10; \
*--p = base10_palindrome[9 + (quotient - number*10)]; \
} while (number); \
if (quotient < 0) *--p = '-'
integer quotient(integer n, integer d)
Definition: aptex-src.c:38689
#define base10_palindrome
Definition: utilnumber.h:80

Definition at line 301 of file utilnumber.c.

◆ number_printrev_signed_radix

#define number_printrev_signed_radix (   p,
  number,
  radix,
  quotient,
  uc 
)
Value:
do { \
if (quotient < 0) *--p = '-'; \
} while (0)
#define number_printrev_signed_radix_uc(p, number, radix, quotient)
Definition: utilnumber.c:372
#define number_printrev_signed_radix_lc(p, number, radix, quotient)
Definition: utilnumber.c:378

Definition at line 384 of file utilnumber.c.

◆ number_printrev_signed_radix_lc

#define number_printrev_signed_radix_lc (   p,
  number,
  radix,
  quotient 
)
Value:
do { \
quotient = number; number /= radix; \
} while (number)
#define MAX_RADIX
Definition: utilnumber.h:62
#define base36_lc_palindrome
Definition: utilnumber.h:75

Definition at line 378 of file utilnumber.c.

◆ number_printrev_signed_radix_uc

#define number_printrev_signed_radix_uc (   p,
  number,
  radix,
  quotient 
)
Value:
do { \
quotient = number; number /= radix; \
} while (number)
#define base36_uc_palindrome
Definition: utilnumber.h:76

Definition at line 372 of file utilnumber.c.

◆ number_printrev_unsigned

#define number_printrev_unsigned (   p,
  number,
  quotient 
)
Value:
do { \
quotient = number; number /= 10; \
*--p = (char)(quotient - integer_multiplied10(number)) + '0'; \
} while (number)
#define integer_multiplied10(number)
Definition: utilnumber.h:337

Definition at line 308 of file utilnumber.c.

◆ number_printrev_unsigned_alpha_lc

#define number_printrev_unsigned_alpha_lc (   p,
  number,
  radix,
  quotient 
)
Value:
while (number > 0) { \
quotient = --number; number /= radix; \
}

Definition at line 512 of file utilnumber.c.

◆ number_printrev_unsigned_alpha_uc

#define number_printrev_unsigned_alpha_uc (   p,
  number,
  radix,
  quotient 
)
Value:
while (number > 0) { \
quotient = --number; number /= radix; \
}

Definition at line 506 of file utilnumber.c.

◆ number_printrev_unsigned_radix

#define number_printrev_unsigned_radix (   p,
  number,
  radix,
  quotient,
  uc 
)
Value:
do { \
} while (0)
#define number_printrev_unsigned_radix_uc(p, number, radix, quotient)
Definition: utilnumber.c:391
#define number_printrev_unsigned_radix_lc(p, number, radix, quotient)
Definition: utilnumber.c:397

Definition at line 403 of file utilnumber.c.

◆ number_printrev_unsigned_radix_lc

#define number_printrev_unsigned_radix_lc (   p,
  number,
  radix,
  quotient 
)
Value:
do { \
quotient = number; number /= radix; \
} while (number)
#define base36_lc_alphabet
Definition: utilnumber.h:69

Definition at line 397 of file utilnumber.c.

◆ number_printrev_unsigned_radix_uc

#define number_printrev_unsigned_radix_uc (   p,
  number,
  radix,
  quotient 
)
Value:
do { \
quotient = number; number /= radix; \
} while (number)
#define base36_uc_alphabet
Definition: utilnumber.h:68

Definition at line 391 of file utilnumber.c.

◆ RADIX_CHAR

#define RADIX_CHAR   '.'

Definition at line 650 of file utilnumber.c.

◆ roman1

#define roman1 (   c)    (c == 'I' || c == 'i')

Definition at line 217 of file utilnumber.c.

◆ roman10

#define roman10 (   c)    (c == 'X' || c == 'x')

Definition at line 215 of file utilnumber.c.

◆ roman100

#define roman100 (   c)    (c == 'C' || c == 'c')

Definition at line 213 of file utilnumber.c.

◆ roman1000

#define roman1000 (   c)    (c == 'M' || c == 'm')

Definition at line 211 of file utilnumber.c.

◆ roman100s

#define roman100s (   p)    (roman100(*p) ? (100 + ((++p, roman100(*p)) ? (100 + ((++p, roman100(*p)) ? (++p, 100) : 0)) : 0)) : 0)

Definition at line 219 of file utilnumber.c.

◆ roman10s

#define roman10s (   p)    (roman10(*p) ? (10 + ((++p, roman10(*p)) ? (10 + ((++p, roman10(*p)) ? (++p, 10) : 0)) : 0)) : 0)

Definition at line 220 of file utilnumber.c.

◆ roman1s

#define roman1s (   p)    (roman1(*p) ? (1 + ((++p, roman1(*p)) ? (1 + ((++p, roman1(*p)) ? (++p, 1) : 0)) : 0)) : 0)

Definition at line 221 of file utilnumber.c.

◆ roman5

#define roman5 (   c)    (c == 'V' || c == 'v')

Definition at line 216 of file utilnumber.c.

◆ roman50

#define roman50 (   c)    (c == 'L' || c == 'l')

Definition at line 214 of file utilnumber.c.

◆ roman500

#define roman500 (   c)    (c == 'D' || c == 'd')

Definition at line 212 of file utilnumber.c.

◆ SIGNED_INFINITY

#define SIGNED_INFINITY   1

Definition at line 647 of file utilnumber.c.

◆ SIGNED_NOT_A_NUMBER

#define SIGNED_NOT_A_NUMBER   0

Definition at line 649 of file utilnumber.c.

◆ SIGNED_ZERO

#define SIGNED_ZERO   0

Definition at line 648 of file utilnumber.c.

◆ SINTTYPE_AS_RADIX

#define SINTTYPE_AS_RADIX (   inttype,
  number,
  radix,
  uc,
  ibuf,
  psize 
)
Value:
char *p, *e; \
inttype quotient; \
e = p = end_of_integer_buffer(ibuf); *p = '\0'; \
number_printrev_signed_radix(p, number, radix, quotient, uc); \
*psize = (size_t)(e - p)
#define size_t
Definition: glob.c:257
char ibuf[32000]
Definition: ps_tiny.c:177
#define end_of_integer_buffer(integer_buffer)
Definition: utilnumber.c:299

Definition at line 409 of file utilnumber.c.

◆ SINTTYPE_AS_STRING

#define SINTTYPE_AS_STRING (   inttype,
  number,
  ibuf,
  psize 
)
Value:
char *p, *e; \
inttype quotient; \
e = p = end_of_integer_buffer(ibuf); *p = '\0'; \
number_printrev_signed(p, number, quotient); \
*psize = (size_t)(e - p)

Definition at line 314 of file utilnumber.c.

◆ string_read_integer

#define string_read_integer (   s,
  c,
  number 
)    _read_integer(c, number, *++s)

Definition at line 96 of file utilnumber.c.

◆ string_read_radix

#define string_read_radix (   s,
  c,
  number,
  radix 
)    _read_radix(c, number, radix, *++s)

Definition at line 97 of file utilnumber.c.

◆ string_scan_alpha

#define string_scan_alpha (   s,
  c,
  number,
  radix 
)     for (number = 0, c = *s; (c = base26_value(c)) > 0; number = number * radix + c, c = *++s)

Definition at line 475 of file utilnumber.c.

◆ string_scan_alphan

#define string_scan_alphan (   s,
  c,
  number,
  radix 
)
Value:
do { \
number = 0; \
if ((c = (uint16_t)base26_value(*s)) > 0) { \
number = c; \
while (c == (uint16_t)base26_value(*++s)) number += radix; \
} \
} while (0)
unsigned short uint16_t
Definition: stdint.h:79
#define base26_value(c)
Definition: utilnumber.h:103

Definition at line 553 of file utilnumber.c.

◆ string_scan_decimal

#define string_scan_decimal (   s,
  c,
  number 
)    _scan_decimal(c, number, *++s)

Definition at line 1041 of file utilnumber.c.

◆ string_scan_exponent10

#define string_scan_exponent10 (   s,
  c,
  exponent10 
)    _scan_exponent10(c, exponent10, *++s)

Definition at line 1043 of file utilnumber.c.

◆ string_scan_fraction

#define string_scan_fraction (   s,
  c,
  number,
  exponent10 
)    _scan_fraction(c, number, exponent10, *++s)

Definition at line 1042 of file utilnumber.c.

◆ string_scan_integer

#define string_scan_integer (   s,
  c,
  number 
)    _scan_integer(c, number, *++s)

Definition at line 94 of file utilnumber.c.

◆ string_scan_radix

#define string_scan_radix (   s,
  c,
  number,
  radix 
)    _scan_radix(c, number, radix, *++s)

Definition at line 95 of file utilnumber.c.

◆ string_scan_sign

#define string_scan_sign (   s,
  c,
  sign 
)    _scan_sign(c, sign, *++s)

Definition at line 93 of file utilnumber.c.

◆ UINTTYPE_AS_ALPHA

#define UINTTYPE_AS_ALPHA (   inttype,
  number,
  uc,
  ibuf,
  psize 
)
Value:
char *p, *e; \
inttype quotient; \
e = p = end_of_integer_buffer(ibuf); *p = '\0'; \
*psize = (size_t)(e - p)
#define number_printrev_unsigned_alpha_lc(p, number, radix, quotient)
Definition: utilnumber.c:512
#define number_printrev_unsigned_alpha_uc(p, number, radix, quotient)
Definition: utilnumber.c:506

Definition at line 518 of file utilnumber.c.

◆ UINTTYPE_AS_ALPHAN

#define UINTTYPE_AS_ALPHAN (   inttype,
  number,
  uc,
  ibuf,
  size,
  psize 
)
Value:
char *p, *e; \
uint8_t c; \
p = ibuf; \
e = p + size; \
if (number > 0) { \
if (uc) { number_print_alphan_uc(p, e, c, number, 26); } \
else { number_print_alphan_lc(p, e, c, number, 26); } \
} \
*p = '\0'; \
*psize = (size_t)(p - ibuf)
static int size
Definition: ppmlabel.c:24
#define number_print_alphan_uc(p, e, c, number, radix)
Definition: utilnumber.c:569
#define number_print_alphan_lc(p, e, c, number, radix)
Definition: utilnumber.c:575

Definition at line 581 of file utilnumber.c.

◆ UINTTYPE_AS_RADIX

#define UINTTYPE_AS_RADIX (   inttype,
  number,
  radix,
  uc,
  ibuf,
  psize 
)
Value:
char *p, *e; \
inttype quotient; \
e = p = end_of_integer_buffer(ibuf); *p = '\0'; \
number_printrev_unsigned_radix(p, number, radix, quotient, uc); \
*psize = (size_t)(e - p)

Definition at line 416 of file utilnumber.c.

◆ UINTTYPE_AS_STRING

#define UINTTYPE_AS_STRING (   inttype,
  number,
  ibuf,
  psize 
)
Value:
char *p, *e; \
inttype quotient; \
e = p = end_of_integer_buffer(ibuf); *p = '\0'; \
number_printrev_unsigned(p, number, quotient); \
*psize = (size_t)(e - p)

Definition at line 321 of file utilnumber.c.

Typedef Documentation

◆ ieee_double

typedef struct ieee_double ieee_double

◆ ieee_float

typedef struct ieee_float ieee_float

Function Documentation

◆ alpha_to_uint32()

const char* alpha_to_uint32 ( const char *  s,
uint32_t number 
)

Definition at line 478 of file utilnumber.c.

References c, s, and string_scan_alpha.

◆ alpha_to_uint64()

const char* alpha_to_uint64 ( const char *  s,
uint64_t number 
)

Definition at line 499 of file utilnumber.c.

References c, s, and string_scan_alpha.

◆ alpha_to_ulong()

const char* alpha_to_ulong ( const char *  s,
unsigned long *  number 
)

Definition at line 485 of file utilnumber.c.

References c, s, and string_scan_alpha.

◆ alpha_to_usize()

const char* alpha_to_usize ( const char *  s,
size_t number 
)

Definition at line 492 of file utilnumber.c.

References c, s, and string_scan_alpha.

◆ alphan_to_uint16()

const char* alphan_to_uint16 ( const char *  s,
uint16_t number 
)

Definition at line 562 of file utilnumber.c.

References c, s, and string_scan_alphan.

◆ bytes_to_hex_lc()

size_t bytes_to_hex_lc ( const void input,
size_t  size,
unsigned char *  output 
)

Definition at line 1127 of file utilnumber.c.

References base16_lc_digit1, base16_lc_digit2, i, p, and size.

◆ bytes_to_hex_uc()

size_t bytes_to_hex_uc ( const void input,
size_t  size,
unsigned char *  output 
)

Definition at line 1140 of file utilnumber.c.

References base16_uc_digit1, base16_uc_digit2, i, p, and size.

◆ convert_to_double()

const char* convert_to_double ( const char *  s,
double *  number 
)

◆ convert_to_float()

const char* convert_to_float ( const char *  s,
float *  number 
)

◆ double_as_string()

◆ float_as_string()

◆ hex_to_bytes()

size_t hex_to_bytes ( const void input,
size_t  size,
unsigned char *  output 
)

Definition at line 1153 of file utilnumber.c.

References base16_value, c1, c2, i, p, and size.

◆ int32_as_radix()

char* int32_as_radix ( int32_t  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 423 of file utilnumber.c.

References ibuf, p, radix, and SINTTYPE_AS_RADIX.

◆ int32_as_string()

char* int32_as_string ( int32_t  number,
char  ibuf[65],
size_t psize 
)

Definition at line 328 of file utilnumber.c.

References ibuf, p, and SINTTYPE_AS_STRING.

◆ int64_as_radix()

char* int64_as_radix ( int64_t  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 443 of file utilnumber.c.

References ibuf, p, radix, and SINTTYPE_AS_RADIX.

◆ int64_as_string()

char* int64_as_string ( int64_t  number,
char  ibuf[65],
size_t psize 
)

Definition at line 340 of file utilnumber.c.

References ibuf, p, and SINTTYPE_AS_STRING.

◆ print_as_hex()

void print_as_hex ( const void input,
size_t  bytes 
)

Definition at line 1172 of file utilnumber.c.

References bytes, p, and printf().

◆ radix_to_int32()

const char* radix_to_int32 ( const char *  s,
int32_t number,
int  radix 
)

Definition at line 154 of file utilnumber.c.

References c, number, radix, s, sign, string_scan_radix, and string_scan_sign.

◆ radix_to_int64()

const char* radix_to_int64 ( const char *  s,
int64_t number,
int  radix 
)

Definition at line 172 of file utilnumber.c.

References c, number, radix, s, sign, string_scan_radix, and string_scan_sign.

◆ radix_to_slong()

const char* radix_to_slong ( const char *  s,
long *  number,
int  radix 
)

Definition at line 163 of file utilnumber.c.

References c, number, radix, s, sign, string_scan_radix, and string_scan_sign.

◆ radix_to_uint32()

const char* radix_to_uint32 ( const char *  s,
uint32_t number,
int  radix 
)

Definition at line 181 of file utilnumber.c.

References c, radix, s, and string_scan_radix.

◆ radix_to_uint64()

const char* radix_to_uint64 ( const char *  s,
uint64_t number,
int  radix 
)

Definition at line 202 of file utilnumber.c.

References c, radix, s, and string_scan_radix.

◆ radix_to_ulong()

const char* radix_to_ulong ( const char *  s,
unsigned long *  number,
int  radix 
)

Definition at line 188 of file utilnumber.c.

References c, radix, s, and string_scan_radix.

◆ radix_to_usize()

const char* radix_to_usize ( const char *  s,
size_t number,
int  radix 
)

Definition at line 195 of file utilnumber.c.

References c, radix, s, and string_scan_radix.

◆ roman_to_uint16()

const char* roman_to_uint16 ( const char *  s,
uint16_t number 
)

Definition at line 223 of file utilnumber.c.

References p, roman1, roman10, roman100, roman1000, roman100s, roman10s, roman1s, roman5, roman50, roman500, and s.

◆ slong_as_radix()

char* slong_as_radix ( long  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 429 of file utilnumber.c.

References ibuf, p, radix, and SINTTYPE_AS_RADIX.

◆ slong_as_string()

char* slong_as_string ( long  number,
char  ibuf[65],
size_t psize 
)

Definition at line 334 of file utilnumber.c.

References ibuf, p, and SINTTYPE_AS_STRING.

◆ string_to_double()

const char* string_to_double ( const char *  s,
double *  number 
)

◆ string_to_float()

const char* string_to_float ( const char *  s,
float *  number 
)

◆ string_to_int32()

const char* string_to_int32 ( const char *  s,
int32_t number 
)

Definition at line 99 of file utilnumber.c.

References c, number, s, sign, string_scan_integer, and string_scan_sign.

◆ string_to_int64()

const char* string_to_int64 ( const char *  s,
int64_t number 
)

Definition at line 117 of file utilnumber.c.

References c, number, s, sign, string_scan_integer, and string_scan_sign.

◆ string_to_slong()

const char* string_to_slong ( const char *  s,
long *  number 
)

Definition at line 108 of file utilnumber.c.

References c, number, s, sign, string_scan_integer, and string_scan_sign.

◆ string_to_uint32()

const char* string_to_uint32 ( const char *  s,
uint32_t number 
)

Definition at line 126 of file utilnumber.c.

References c, s, and string_scan_integer.

◆ string_to_uint64()

const char* string_to_uint64 ( const char *  s,
uint64_t number 
)

Definition at line 147 of file utilnumber.c.

References c, s, and string_scan_integer.

◆ string_to_ulong()

const char* string_to_ulong ( const char *  s,
unsigned long *  number 
)

Definition at line 133 of file utilnumber.c.

References c, s, and string_scan_integer.

◆ string_to_usize()

const char* string_to_usize ( const char *  s,
size_t number 
)

Definition at line 140 of file utilnumber.c.

References c, s, and string_scan_integer.

◆ uint16_as_alphan()

char* uint16_as_alphan ( uint16_t  number,
int  uc,
char  ibuf[],
size_t  size,
size_t psize 
)

Definition at line 593 of file utilnumber.c.

References ibuf, size, and UINTTYPE_AS_ALPHAN.

◆ uint16_as_roman()

char* uint16_as_roman ( uint16_t  number,
int  uc,
char  ibuf[128],
size_t psize 
)

Definition at line 606 of file utilnumber.c.

References alphabet(), base_roman_lc_alphabet, base_roman_uc_alphabet, ibuf, j, k, n, p, size_t, u, uint32_t, and v.

◆ uint32_as_alpha()

char* uint32_as_alpha ( uint32_t  number,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 526 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_ALPHA.

◆ uint32_as_radix()

char* uint32_as_radix ( uint32_t  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 449 of file utilnumber.c.

References ibuf, p, radix, and UINTTYPE_AS_RADIX.

◆ uint32_as_string()

char* uint32_as_string ( uint32_t  number,
char  ibuf[65],
size_t psize 
)

Definition at line 346 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_STRING.

◆ uint64_as_alpha()

char* uint64_as_alpha ( uint64_t  number,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 544 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_ALPHA.

◆ uint64_as_radix()

char* uint64_as_radix ( uint64_t  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 467 of file utilnumber.c.

References ibuf, p, radix, and UINTTYPE_AS_RADIX.

◆ uint64_as_string()

char* uint64_as_string ( uint64_t  number,
char  ibuf[65],
size_t psize 
)

Definition at line 364 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_STRING.

◆ ulong_as_alpha()

char* ulong_as_alpha ( unsigned long  number,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 532 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_ALPHA.

◆ ulong_as_radix()

char* ulong_as_radix ( unsigned long  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 455 of file utilnumber.c.

References ibuf, p, radix, and UINTTYPE_AS_RADIX.

◆ ulong_as_string()

char* ulong_as_string ( unsigned long  number,
char  ibuf[65],
size_t psize 
)

Definition at line 352 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_STRING.

◆ usize_as_alpha()

char* usize_as_alpha ( size_t  number,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 538 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_ALPHA.

◆ usize_as_radix()

char* usize_as_radix ( size_t  number,
int  radix,
int  uc,
char  ibuf[65],
size_t psize 
)

Definition at line 461 of file utilnumber.c.

References ibuf, p, radix, and UINTTYPE_AS_RADIX.

◆ usize_as_string()

char* usize_as_string ( size_t  number,
char  ibuf[65],
size_t psize 
)

Definition at line 358 of file utilnumber.c.

References ibuf, p, and UINTTYPE_AS_STRING.

Variable Documentation

◆ base10_lookup

const int base10_lookup[]
Initial value:
= {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
}

Definition at line 11 of file utilnumber.c.

◆ base16_lookup

const int base16_lookup[]
Initial value:
= {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
}

Definition at line 30 of file utilnumber.c.

◆ base26_lookup

const int base26_lookup[]
Initial value:
= {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,-1,-1,-1,-1,-1,
-1, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
}

Definition at line 49 of file utilnumber.c.

◆ base36_lookup

const int base36_lookup[]
Initial value:
= {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
}

Definition at line 68 of file utilnumber.c.

◆ double_decimal_negpower10

const double double_decimal_negpower10[]

Definition at line 779 of file utilnumber.c.

◆ double_decimal_power10

const double double_decimal_power10[]

Definition at line 738 of file utilnumber.c.

◆ float_decimal_negpower10

const float float_decimal_negpower10[]
Initial value:
= {
1.0e0f, 1.0e-1f, 1.0e-2f, 1.0e-3f, 1.0e-4f, 1.0e-5f, 1.0e-6f, 1.0e-7f, 1.0e-8f, 1.0e-9f,
1.0e-10f, 1.0e-11f, 1.0e-12f, 1.0e-13f, 1.0e-14f, 1.0e-15f, 1.0e-16f, 1.0e-17f, 1.0e-18f, 1.0e-19f,
1.0e-20f, 1.0e-21f, 1.0e-22f, 1.0e-23f, 1.0e-24f, 1.0e-25f, 1.0e-26f, 1.0e-27f, 1.0e-28f, 1.0e-29f,
1.0e-30f, 1.0e-31f, 1.0e-32f, 1.0e-33f, 1.0e-34f, 1.0e-35f, 1.0e-36f, 1.0e-37f, 1.0e-38f
}

Definition at line 813 of file utilnumber.c.

◆ float_decimal_power10

const float float_decimal_power10[]
Initial value:
= {
1.0e0f, 1.0e1f, 1.0e2f, 1.0e3f, 1.0e4f, 1.0e5f, 1.0e6f, 1.0e7f, 1.0e8f, 1.0e9f,
1.0e10f, 1.0e11f, 1.0e12f, 1.0e13f, 1.0e14f, 1.0e15f, 1.0e16f, 1.0e17f, 1.0e18f, 1.0e19f,
1.0e20f, 1.0e21f, 1.0e22f, 1.0e23f, 1.0e24f, 1.0e25f, 1.0e26f, 1.0e27f, 1.0e28f, 1.0e29f,
1.0e30f, 1.0e31f, 1.0e32f, 1.0e33f, 1.0e34f, 1.0e35f, 1.0e36f, 1.0e37f, 1.0e38f
}

Definition at line 772 of file utilnumber.c.

◆ util_number_buffer

char util_number_buffer[ 512] = { 0 }

Definition at line 89 of file utilnumber.c.