On Thu, Aug 15, 2024 at 02:56:00PM +0800, jian he wrote: > i am confused with > " > +#elif defined(HAVE_INT128) > + uint128 res = -((int128) a); > " > I thought "unsigned" means non-negative, therefore uint128 means non-negative. > therefore "int128 res = -((int128) a);" makes sense to me.
Ah, that's a typo, thanks for pointing it out. > also in HAVE_INT128 branch > do we need cast int128 to int64, like > > *result = (int64) res; I don't think we need an explicit cast here since *result is known to be an int64. But it certainly wouldn't hurt anything... -- nathan