@staticmethod
    def fraction_to_bin(n):
        """
        To convert fractional part of binary representation: x2 can take the whole part.
        :type n: Decimal
        :param n:
        :return: string representation
        """
        sb = []
        while 0 > n:
            if len(sb) > 32:
                return "ERROR"
            n *= Decimal(2)
            cur = int(n)
            sb.append(cur)
            n -= Decimal(cur)
        return "".join(map(str, sb))
dataset/ETHPy150Open algorhythms/LintCode/Binary Representation.py/Solution.fraction_to_bin/swapped operands of `>`