/[guile]/guile/guile-core/libguile/numbers.c
ViewVC logotype

Diff of /guile/guile-core/libguile/numbers.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.198 by kryde, Fri Aug 22 01:17:48 2003 UTC revision 1.199 by kryde, Sat Aug 30 00:04:42 2003 UTC
# Line 1247  SCM_DEFINE (scm_lognot, "lognot", 1, 0, Line 1247  SCM_DEFINE (scm_lognot, "lognot", 1, 0,
1247              "@end lisp")              "@end lisp")
1248  #define FUNC_NAME s_scm_lognot  #define FUNC_NAME s_scm_lognot
1249  {  {
1250    return scm_difference (SCM_MAKINUM (-1L), n);    if (SCM_INUMP (n)) {
1251        /* No overflow here, just need to toggle all the bits making up the inum.
1252           Enhancement: No need to strip the tag and add it back, could just xor
1253           a block of 1 bits, if that worked with the various debug versions of
1254           the SCM typedef.  */
1255        return SCM_MAKINUM (~ SCM_INUM (n));
1256    
1257      } else if (SCM_BIGP (n)) {
1258        SCM result = scm_i_mkbig ();
1259        mpz_com (SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (n));
1260        scm_remember_upto_here_1 (n);
1261        return result;
1262    
1263      } else {
1264        SCM_WRONG_TYPE_ARG (SCM_ARG1, n);
1265      }
1266  }  }
1267  #undef FUNC_NAME  #undef FUNC_NAME
1268    

Legend:
Removed from v.1.198  
changed lines
  Added in v.1.199

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26