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 |
|
|