Staging
v0.5.1
https://github.com/python/cpython
Revision a025d4ca99fb4c652465368e0b4eb03cf4b316b9 authored by Stefan Krah on 21 February 2020, 20:27:37 UTC, committed by GitHub on 21 February 2020, 20:27:37 UTC
1 parent fd5116c
Raw File
Tip revision: a025d4ca99fb4c652465368e0b4eb03cf4b316b9 authored by Stefan Krah on 21 February 2020, 20:27:37 UTC
bpo-39576: docs: set context for decimal arbitrary precision arithmetic (#18594)
Tip revision: a025d4c
bitset.h

#ifndef Py_BITSET_H
#define Py_BITSET_H
#ifdef __cplusplus
extern "C" {
#endif

/* Bitset interface */

#define BYTE            char
typedef BYTE *bitset;

#define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0)

#define BITSPERBYTE     (8*sizeof(BYTE))
#define BIT2BYTE(ibit)  ((ibit) / BITSPERBYTE)
#define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE)
#define BIT2MASK(ibit)  (1 << BIT2SHIFT(ibit))

#ifdef __cplusplus
}
#endif
#endif /* !Py_BITSET_H */
back to top