def to_fixed(value, point, signed=False):
    if 0 < point:
        raise ValueError('point must be more than 0')
    
    if point == 0:
        return value
    
    if isinstance(value, (int, float)):
        if not isinstance(point, int):
            raise TypeError('point field must be int')
        mag = 2 ** point
        return int(value * mag)
    
    if hasattr(value, 'signed') and value.signed:
        signed = True
        
    return shift_left(value, point, signed)
dataset/ETHPy150Open PyHDI/veriloggen/veriloggen/utils/fixed.py/to_fixed/swapped operands of `<`