moreinttypes 1.9.0
Minimal library of enhanced integer types for C
Loading...
Searching...
No Matches
Interface

Simplifies manipulation of integer types. More...

Macros

#define increment(i)
 Adds 1 to the value of the given integer type.
 
#define decrement(i)
 Subtracts 1 from the value of the given integer type.
 
#define negate(i)
 Negates the value of the given integer type.
 
#define factorial(i)
 Returns the factorial of the given integer type.
 
#define from_string(i, str, b)
 Tries to set the value of the given integer type by parsing a numeric string.
 
#define as_binary(i)
 Returns the binary equivalent of the given integer type as a string.
 

Detailed Description

Simplifies manipulation of integer types.

These function macros accept any integral type, i.e., any struct representing an integer.

Macro Definition Documentation

◆ as_binary

#define as_binary (   i)

Returns the binary equivalent of the given integer type as a string.

Parameters
iAn integer type.
Returns
A string representation of i in base-2 notation.

◆ decrement

#define decrement (   i)

Subtracts 1 from the value of the given integer type.

Parameters
iAn integer type.

◆ factorial

#define factorial (   i)

Returns the factorial of the given integer type.

Parameters
iAn integer type.
Returns
The factorial of i, if computable, otherwise 0.

◆ from_string

#define from_string (   i,
  str,
  b 
)

Tries to set the value of the given integer type by parsing a numeric string.

Parameters
iAn integer type.
strA string representation of an integral value.
bThe radix to use when parsing str.

◆ increment

#define increment (   i)

Adds 1 to the value of the given integer type.

Parameters
iAn integer type.

◆ negate

#define negate (   i)

Negates the value of the given integer type.

Parameters
iAn integer type.