You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has the expected behaviour of 32 termId bits followed by 32 termOffset bits.
While in C++ the same code is implemented with:
((termId << 32) + termOffset)
Where termId is cast to an int64_t implicitly at the function call.
I suppose both termId and termOffset can take negative values. In that case the two implementations produce different results. Also it is possible to get numeric overflow. And, furthermore, left shift of negative integers is undefined in C and C++ even though most implementations pad zeroes.
putRawTailOrdered()
in Java is implemented withpackTail()
with the implementation below:This has the expected behaviour of 32
termId
bits followed by 32termOffset
bits.While in C++ the same code is implemented with:
((termId << 32) + termOffset)
Where
termId
is cast to anint64_t
implicitly at the function call.I suppose both
termId
andtermOffset
can take negative values. In that case the two implementations produce different results. Also it is possible to get numeric overflow. And, furthermore, left shift of negative integers is undefined in C and C++ even though most implementations pad zeroes.Compatible C++ implementation is:
The text was updated successfully, but these errors were encountered: