All files / src/gates not.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 3/3
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 168x       1x 12x           1x     8x  
import {stde} from '../stde';
 
class Not extends stde {
    constructor(in_count: number) { //todo in_count>30
        super('NOT', in_count, in_count, (a) => {
            return (~parseInt(a, 2)>>>0).toString(2).slice(-in_count).padStart(in_count, '1');;
        });
    }
}
 
function not(in_count: number) {
    return new Not(in_count);
}
 
export {Not, not};