https://www.cdslab.org/paramonte/fortran/2
Current view: top level - main - pm_mathUnsigned@routines.inc.F90 (source / functions) Hit Total Coverage
Test: ParaMonte 2.0.0 :: Serial Fortran - Code Coverage Report Lines: 7 7 100.0 %
Date: 2024-04-08 03:18:57 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       2             : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       3             : !!!!                                                                                                                            !!!!
       4             : !!!!    ParaMonte: Parallel Monte Carlo and Machine Learning Library.                                                           !!!!
       5             : !!!!                                                                                                                            !!!!
       6             : !!!!    Copyright (C) 2012-present, The Computational Data Science Lab                                                          !!!!
       7             : !!!!                                                                                                                            !!!!
       8             : !!!!    This file is part of the ParaMonte library.                                                                             !!!!
       9             : !!!!                                                                                                                            !!!!
      10             : !!!!    LICENSE                                                                                                                 !!!!
      11             : !!!!                                                                                                                            !!!!
      12             : !!!!       https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md                                                          !!!!
      13             : !!!!                                                                                                                            !!!!
      14             : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      15             : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      16             : 
      17             : !>  \brief
      18             : !>  This include file contains implementations of the procedures in module [pm_mathUnsigned](@ref pm_mathUnsigned).
      19             : !>
      20             : !>  \finmain
      21             : !>
      22             : !>  \author
      23             : !>  \FatemehBagheri, Sunday 11:23 PM, September 19, 2021, Dallas, TX
      24             : 
      25             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      26             : 
      27             : #if     uadd_ENABLED && IK_ENABLED
      28             :         integer(IKC) :: aa, bb
      29             :         integer(IKC), parameter :: HUGE_IKC = huge(0_IKC) !, SIGNBITLOC = bit_size(a) - 1_IKC
      30           8 :         CHECK_ASSERTION(__LINE__, 0_IKC <= a, SK_"@getFactoring(): The condition `0 <= a` must hold for corresponding input arguments. a = "//getStr(a))
      31           8 :         CHECK_ASSERTION(__LINE__, 0_IKC <= b, SK_"@getFactoring(): The condition `0 <= b` must hold for corresponding input arguments. b = "//getStr(b))
      32           8 :         if (HUGE_IKC - a < b) then ! overflowed.
      33             :             !aa = ibset(a, SIGNBITLOC)
      34             :             !bb = ibset(b, SIGNBITLOC)
      35           6 :             aa = a - HUGE_IKC - 1_IKC
      36           6 :             bb = b - HUGE_IKC - 1_IKC
      37           6 :             sum = aa + bb
      38             :         else
      39           2 :             sum = a + b
      40             :         end if
      41             : #else
      42             : #error  "Unrecognized interface."
      43             : #endif

ParaMonte: Parallel Monte Carlo and Machine Learning Library 
The Computational Data Science Lab
© Copyright 2012 - 2024