UNPKG
@mousepox/math
Version:
latest (1.7.3)
1.7.3
1.7.2
1.7.1
1.7.0
1.6.1
1.6.0
1.5.0
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0
Math-related objects and utilities
@mousepox/math
/
dist-es
/
BitFlags.js
16 lines
(15 loc)
•
259 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export
class
BitFlags
{ value;
constructor
(
value
) {
this
.
value
= value ??
0
; }
clear
(
) {
this
.
value
=
0
; }
set
(
mask
) {
this
.
value
|= mask; }
has
(
mask
) {
return
(
this
.
value
& mask) !==
0
; } }