Functions
picotm-arithmetic-ctypes.h File Reference

Transactional, safe arithmetics for native C types. More...

#include <float.h>
#include <limits.h>
#include <picotm/compiler.h>
#include <stdlib.h>
#include "picotm-arithmetic.h"

Functions

static _Bool add__Bool_tx (_Bool lhs, _Bool rhs)
 
static char add_char_tx (char lhs, char rhs)
 
static double add_double_tx (double lhs, double rhs)
 
static float add_float_tx (float lhs, float rhs)
 
static int add_int_tx (int lhs, int rhs)
 
static long double add_ldouble_tx (long double lhs, long double rhs)
 
static long long add_llong_tx (long long lhs, long long rhs)
 
static long add_long_tx (long lhs, long rhs)
 
static signed char add_schar_tx (signed char lhs, signed char rhs)
 
static short add_short_tx (short lhs, short rhs)
 
static unsigned char add_uchar_tx (unsigned char lhs, unsigned char rhs)
 
static unsigned int add_uint_tx (unsigned int lhs, unsigned int rhs)
 
static unsigned long long add_ullong_tx (unsigned long long lhs, unsigned long long rhs)
 
static unsigned long add_ulong_tx (unsigned long lhs, unsigned long rhs)
 
static unsigned short add_ushort_tx (unsigned short lhs, unsigned short rhs)
 
static _Bool div__Bool_tx (_Bool lhs, _Bool rhs)
 
static char div_char_tx (char lhs, char rhs)
 
static double div_double_tx (double lhs, double rhs)
 
static float div_float_tx (float lhs, float rhs)
 
static int div_int_tx (int lhs, int rhs)
 
static long double div_ldouble_tx (long double lhs, long double rhs)
 
static long long div_llong_tx (long long lhs, long long rhs)
 
static long div_long_tx (long lhs, long rhs)
 
static signed char div_schar_tx (signed char lhs, signed char rhs)
 
static short div_short_tx (short lhs, short rhs)
 
static unsigned char div_uchar_tx (unsigned char lhs, unsigned char rhs)
 
static unsigned int div_uint_tx (unsigned int lhs, unsigned int rhs)
 
static unsigned long long div_ullong_tx (unsigned long long lhs, unsigned long long rhs)
 
static unsigned long div_ulong_tx (unsigned long lhs, unsigned long rhs)
 
static unsigned short div_ushort_tx (unsigned short lhs, unsigned short rhs)
 
static _Bool mul__Bool_tx (_Bool lhs, _Bool rhs)
 
static char mul_char_tx (char lhs, char rhs)
 
static double mul_double_tx (double lhs, double rhs)
 
static float mul_float_tx (float lhs, float rhs)
 
static int mul_int_tx (int lhs, int rhs)
 
static long double mul_ldouble_tx (long double lhs, long double rhs)
 
static long long mul_llong_tx (long long lhs, long long rhs)
 
static long mul_long_tx (long lhs, long rhs)
 
static signed char mul_schar_tx (signed char lhs, signed char rhs)
 
static short mul_short_tx (short lhs, short rhs)
 
static unsigned char mul_uchar_tx (unsigned char lhs, unsigned char rhs)
 
static unsigned int mul_uint_tx (unsigned int lhs, unsigned int rhs)
 
static unsigned long long mul_ullong_tx (unsigned long long lhs, unsigned long long rhs)
 
static unsigned long mul_ulong_tx (unsigned long lhs, unsigned long rhs)
 
static unsigned short mul_ushort_tx (unsigned short lhs, unsigned short rhs)
 
static _Bool sub__Bool_tx (_Bool lhs, _Bool rhs)
 
static char sub_char_tx (char lhs, char rhs)
 
static double sub_double_tx (double lhs, double rhs)
 
static float sub_float_tx (float lhs, float rhs)
 
static int sub_int_tx (int lhs, int rhs)
 
static long double sub_ldouble_tx (long double lhs, long double rhs)
 
static long long sub_llong_tx (long long lhs, long long rhs)
 
static long sub_long_tx (long lhs, long rhs)
 
static signed char sub_schar_tx (signed char lhs, signed char rhs)
 
static short sub_short_tx (short lhs, short rhs)
 
static unsigned char sub_uchar_tx (unsigned char lhs, unsigned char rhs)
 
static unsigned int sub_uint_tx (unsigned int lhs, unsigned int rhs)
 
static unsigned long long sub_ullong_tx (unsigned long long lhs, unsigned long long rhs)
 
static unsigned long sub_ulong_tx (unsigned long lhs, unsigned long rhs)
 
static unsigned short sub_ushort_tx (unsigned short lhs, unsigned short rhs)
 

Function Documentation

◆ add__Bool_tx()

static _Bool add__Bool_tx ( _Bool  lhs,
_Bool  rhs 
)
inlinestatic

Adds two values of type _Bool. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ add_char_tx()

static char add_char_tx ( char  lhs,
char  rhs 
)
inlinestatic

Adds two values of type char. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ add_double_tx()

static double add_double_tx ( double  lhs,
double  rhs 
)
inlinestatic

Adds two values of type double. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_float_tx()

static float add_float_tx ( float  lhs,
float  rhs 
)
inlinestatic

Adds two values of type float. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_int_tx()

static int add_int_tx ( int  lhs,
int  rhs 
)
inlinestatic

Adds two values of type int. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_ldouble_tx()

static long double add_ldouble_tx ( long double  lhs,
long double  rhs 
)
inlinestatic

Adds two values of type long double. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_llong_tx()

static long long add_llong_tx ( long long  lhs,
long long  rhs 
)
inlinestatic

Adds two values of type long long. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_long_tx()

static long add_long_tx ( long  lhs,
long  rhs 
)
inlinestatic

Adds two values of type long. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_schar_tx()

static signed char add_schar_tx ( signed char  lhs,
signed char  rhs 
)
inlinestatic

Adds two values of type signed char. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_short_tx()

static short add_short_tx ( short  lhs,
short  rhs 
)
inlinestatic

Adds two values of type short. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the addition's result underflows the type's range.

◆ add_uchar_tx()

static unsigned char add_uchar_tx ( unsigned char  lhs,
unsigned char  rhs 
)
inlinestatic

Adds two values of type unsigned char. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ add_uint_tx()

static unsigned int add_uint_tx ( unsigned int  lhs,
unsigned int  rhs 
)
inlinestatic

Adds two values of type unsigned int. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ add_ullong_tx()

static unsigned long long add_ullong_tx ( unsigned long long  lhs,
unsigned long long  rhs 
)
inlinestatic

Adds two values of type unsigned long long. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ add_ulong_tx()

static unsigned long add_ulong_tx ( unsigned long  lhs,
unsigned long  rhs 
)
inlinestatic

Adds two values of type unsigned long. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ add_ushort_tx()

static unsigned short add_ushort_tx ( unsigned short  lhs,
unsigned short  rhs 
)
inlinestatic

Adds two values of type unsigned short. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side addend.
rhsThe right-hand-side addend.
Returns
The sum of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the addition's result overflows the type's range.

◆ div__Bool_tx()

static _Bool div__Bool_tx ( _Bool  lhs,
_Bool  rhs 
)
inlinestatic

Divides a value of type _Bool by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ div_char_tx()

static char div_char_tx ( char  lhs,
char  rhs 
)
inlinestatic

Divides a value of type char by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ div_double_tx()

static double div_double_tx ( double  lhs,
double  rhs 
)
inlinestatic

Divides a value of type double by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_float_tx()

static float div_float_tx ( float  lhs,
float  rhs 
)
inlinestatic

Divides a value of type float by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_int_tx()

static int div_int_tx ( int  lhs,
int  rhs 
)
inlinestatic

Divides a value of type int by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_ldouble_tx()

static long double div_ldouble_tx ( long double  lhs,
long double  rhs 
)
inlinestatic

Divides a value of type long double by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_llong_tx()

static long long div_llong_tx ( long long  lhs,
long long  rhs 
)
inlinestatic

Divides a value of type long long by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_long_tx()

static long div_long_tx ( long  lhs,
long  rhs 
)
inlinestatic

Divides a value of type long by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_schar_tx()

static signed char div_schar_tx ( signed char  lhs,
signed char  rhs 
)
inlinestatic

Divides a value of type signed char by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_short_tx()

static short div_short_tx ( short  lhs,
short  rhs 
)
inlinestatic

Divides a value of type short by another value of the same type. The function detects divisions by zero, overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.
ERANGEReported to the transaction's recovery phase if the division's result overflows the type's range.

◆ div_uchar_tx()

static unsigned char div_uchar_tx ( unsigned char  lhs,
unsigned char  rhs 
)
inlinestatic

Divides a value of type unsigned char by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ div_uint_tx()

static unsigned int div_uint_tx ( unsigned int  lhs,
unsigned int  rhs 
)
inlinestatic

Divides a value of type unsigned int by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ div_ullong_tx()

static unsigned long long div_ullong_tx ( unsigned long long  lhs,
unsigned long long  rhs 
)
inlinestatic

Divides a value of type unsigned long long by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ div_ulong_tx()

static unsigned long div_ulong_tx ( unsigned long  lhs,
unsigned long  rhs 
)
inlinestatic

Divides a value of type unsigned long by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ div_ushort_tx()

static unsigned short div_ushort_tx ( unsigned short  lhs,
unsigned short  rhs 
)
inlinestatic

Divides a value of type unsigned short by another value of the same type. The function detects divisions by zero, overflows and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side dividend.
rhsThe right-hand-side divisor.
Returns
The fraction of lhs divided by rhs.
Return values
EDOMReported to the transaction's recovery phase if the transaction tries to performed a division by 0.

◆ mul__Bool_tx()

static _Bool mul__Bool_tx ( _Bool  lhs,
_Bool  rhs 
)
inlinestatic

Multiplies two values of type _Bool. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ mul_char_tx()

static char mul_char_tx ( char  lhs,
char  rhs 
)
inlinestatic

Multiplies two values of type char. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ mul_double_tx()

static double mul_double_tx ( double  lhs,
double  rhs 
)
inlinestatic

Multiplies two values of type double. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_float_tx()

static float mul_float_tx ( float  lhs,
float  rhs 
)
inlinestatic

Multiplies two values of type float. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_int_tx()

static int mul_int_tx ( int  lhs,
int  rhs 
)
inlinestatic

Multiplies two values of type int. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_ldouble_tx()

static long double mul_ldouble_tx ( long double  lhs,
long double  rhs 
)
inlinestatic

Multiplies two values of type long double. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_llong_tx()

static long long mul_llong_tx ( long long  lhs,
long long  rhs 
)
inlinestatic

Multiplies two values of type long long. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_long_tx()

static long mul_long_tx ( long  lhs,
long  rhs 
)
inlinestatic

Multiplies two values of type long. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_schar_tx()

static signed char mul_schar_tx ( signed char  lhs,
signed char  rhs 
)
inlinestatic

Multiplies two values of type signed char. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_short_tx()

static short mul_short_tx ( short  lhs,
short  rhs 
)
inlinestatic

Multiplies two values of type short. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the multiplication's result underflows the type's range.

◆ mul_uchar_tx()

static unsigned char mul_uchar_tx ( unsigned char  lhs,
unsigned char  rhs 
)
inlinestatic

Multiplies two values of type unsigned char. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ mul_uint_tx()

static unsigned int mul_uint_tx ( unsigned int  lhs,
unsigned int  rhs 
)
inlinestatic

Multiplies two values of type unsigned int. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ mul_ullong_tx()

static unsigned long long mul_ullong_tx ( unsigned long long  lhs,
unsigned long long  rhs 
)
inlinestatic

Multiplies two values of type unsigned long long. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ mul_ulong_tx()

static unsigned long mul_ulong_tx ( unsigned long  lhs,
unsigned long  rhs 
)
inlinestatic

Multiplies two values of type unsigned long. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ mul_ushort_tx()

static unsigned short mul_ushort_tx ( unsigned short  lhs,
unsigned short  rhs 
)
inlinestatic

Multiplies two values of type unsigned short. The function detects overflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side factor.
rhsThe right-hand-side factor.
Returns
The product of lhs and rhs.
Return values
ERANGEReported to the transaction's recovery phase if the multiplication's result overflows the type's range.

◆ sub__Bool_tx()

static _Bool sub__Bool_tx ( _Bool  lhs,
_Bool  rhs 
)
inlinestatic

Subtracts one value of type _Bool from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_char_tx()

static char sub_char_tx ( char  lhs,
char  rhs 
)
inlinestatic

Subtracts one value of type char from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_double_tx()

static double sub_double_tx ( double  lhs,
double  rhs 
)
inlinestatic

Subtracts one value of type double from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_float_tx()

static float sub_float_tx ( float  lhs,
float  rhs 
)
inlinestatic

Subtracts one value of type float from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_int_tx()

static int sub_int_tx ( int  lhs,
int  rhs 
)
inlinestatic

Subtracts one value of type int from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_ldouble_tx()

static long double sub_ldouble_tx ( long double  lhs,
long double  rhs 
)
inlinestatic

Subtracts one value of type long double from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_llong_tx()

static long long sub_llong_tx ( long long  lhs,
long long  rhs 
)
inlinestatic

Subtracts one value of type long long from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_long_tx()

static long sub_long_tx ( long  lhs,
long  rhs 
)
inlinestatic

Subtracts one value of type long from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_schar_tx()

static signed char sub_schar_tx ( signed char  lhs,
signed char  rhs 
)
inlinestatic

Subtracts one value of type signed char from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_short_tx()

static short sub_short_tx ( short  lhs,
short  rhs 
)
inlinestatic

Subtracts one value of type short from another value of the same type. The function detects overflows and underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result overflows the type's range.
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_uchar_tx()

static unsigned char sub_uchar_tx ( unsigned char  lhs,
unsigned char  rhs 
)
inlinestatic

Subtracts one value of type unsigned char from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_uint_tx()

static unsigned int sub_uint_tx ( unsigned int  lhs,
unsigned int  rhs 
)
inlinestatic

Subtracts one value of type unsigned int from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_ullong_tx()

static unsigned long long sub_ullong_tx ( unsigned long long  lhs,
unsigned long long  rhs 
)
inlinestatic

Subtracts one value of type unsigned long long from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_ulong_tx()

static unsigned long sub_ulong_tx ( unsigned long  lhs,
unsigned long  rhs 
)
inlinestatic

Subtracts one value of type unsigned long from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.

◆ sub_ushort_tx()

static unsigned short sub_ushort_tx ( unsigned short  lhs,
unsigned short  rhs 
)
inlinestatic

Subtracts one value of type unsigned short from another value of the same type. The function detects underflows of the type's range and reports them as errno code to the transaction's recovery phase.

Parameters
lhsThe left-hand-side minuend.
rhsThe right-hand-side subtrahend.
Returns
The difference from rhs to lhs.
Return values
ERANGEReported to the transaction's recovery phase if the subtraction's result underflows the type's range.