ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Generate and return a (possibly overflowed) signed integer that is the result of adding the two input (non-negative) integers without runtime overflow error. More...
Generate and return a (possibly overflowed) signed integer that is the result of adding the two input (non-negative) integers without runtime overflow error.
If the addition operation does not lead to overflow, then the sum matches the outcome of regular addition operation.
If the addition operation does lead to overflow, then bit pattern of the result will match that of the result of the unsigned addition of the two input integers.
See the documentation of pm_mathUnsigned for more information.
[in] | a | : The input scalar, or array of the same rank and shape as other array-like arguments, of type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), containing a (non-negative) signed integer to be added to another input signed integer b without causing overflow. |
[in] | b | : The input scalar, or array of the same rank and shape as other array-like arguments, of the same type and kind as a , containing a (non-negative) signed integer to be added to another input signed integer a without causing overflow. |
sum
: The output scalar, or array of the same rank and shape as other array-like arguments, of the same type and kind as a
, containing the sum of the two input (non-negative) signed integers without causing runtime overflow error.
Possible calling interfaces ⛓
0 <= a
must hold for the corresponding input arguments.0 <= b
must hold for the corresponding input arguments.CHECK_ENABLED=1
.pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.pure
in release
build and impure
in debug
and testing
builds.elemental
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 129 of file pm_mathUnsigned.F90.