Namespaces
Variants
Actions

ckd_sub

From cppreference.com
< cpp‎ | numeric
Defined in header <stdckdint.h>
template< class type1, class type2, class type3 >
bool ckd_sub( type1* result, type2 a, type3 b );
(since C++26)

Computes the subtraction x - y and stores the result into *result. The subtraction is performed as if both operands were represented in a signed integer type with infinite range, and the result was then converted from this integer type to type1. If the value assigned to *result correctly represents the mathematical result of the operation, it returns false. Otherwise, it returns true. In this case, the value assigned to *result is the mathematical result of the operation wrapped around to the width of *result.

Contents