Created
November 3, 2022 08:17
-
-
Save hades2510/ecf3a561325b7dbfa42aa875685d26bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type BitNot<T extends Bit> = T extends Zero ? One : Zero; | |
type BitAnd<LHS extends Bit, RHS extends Bit> = LHS extends One | |
? RHS extends One | |
? One | |
: Zero | |
: Zero; | |
type BitOr<LHS extends Bit, RHS extends Bit> = LHS extends Zero | |
? RHS extends Zero | |
? Zero | |
: One | |
: One; | |
type BitXor<LHS extends Bit, RHS extends Bit> = LHS extends Zero | |
? RHS extends One | |
? One | |
: Zero | |
: RHS extends Zero | |
? One | |
: Zero; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment