IS_SUB_SAFE 3CW "21 March 2008" "mathcw-1.00"

Table of contents


NAME

is_sub_safe, is_sub_safel, is_sub_safell - test for safe integer subtraction

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern int is_sub_safe (int a, int b);

extern int is_sub_safel (long int a, long int b);

extern int is_sub_safell (long long int a, long long int b);

DESCRIPTION

Determine whether the integer arguments can be subtracted safely without overflow.

RETURN VALUES

Return 1 if the operation is safe, and 0 otherwise.

ERRORS

None.

SEE ALSO

is_abs_safe(3CW), is_add_safe(3CW), is_div_safe(3CW), is_mul_safe(3CW), is_neg_safe(3CW), is_rem_safe(3CW).