Availability:Arithmetic function (see is/2)
getbit(+IntExprV,
+IntExprI)Evaluates to the bit value (0 or 1) of the IntExprI-th bit of
IntExprV. Both arguments must evaluate to non-negative
integers. The result is equivalent to (IntExprV >> IntExprI)/\1
,
but more efficient because materialization of the shifted value is
avoided. Future versions will optimise (IntExprV >> IntExprI)/\1
to a call to getbit/2,
providing both portability and performance.135This
issue was fiercely debated at the ISO standard mailinglist. The name getbit
was selected for compatibility with ECLiPSe, the only system providing
this support. Richard O'Keefe disliked the name and argued that
efficient handling of the above implementation is the best choice for
this functionality.