A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/algorithm/../../cpp/numeric/fenv/../../../c/numeric/ckd_add.html below:

ckd_add - cppreference.com

#define ckd_add( result, a, b ) /* implementation-defined */

// exposed interface:

bool ckd_add( type1* result, type2 a, type3 b );
(since C23)

Computes the addition x + y and stores the result into *result. The addition 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.

[edit] Parameters a, b - integer values result - address of where result should be stored [edit] Return value

false if the value assigned to *result correctly represents the mathematical result of the addition, true otherwise.

[edit] Note

Both type2 and type3 shall be any integer type other than “plain” char, bool, a bit-precise integer type, or an enumerated type, and they can be the same. *result shall be a modifiable lvalue of any integer type other than “plain” char, bool, a bit-precise integer type, or an enumerated type.

It is recommended to produce a diagnostic message if type2 or type3 are not suitable integer types, or if *result is not a modifiable lvalue of a suitable integer type.

[edit] Example [edit] References
[edit] See also checked subtraction operation on two integers
(type-generic function macro)[edit] checked multiplication operation on two integers
(type-generic function macro)[edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4