コード例 #1
0
ファイル: value.py プロジェクト: swarupsahoo/dart
 def _do_op(cls, self, other, op):
     first, second = cls(self), cls(other)
     units = second.units or first.units
     value = op(float(first), float(second))
     value /= CONV_FACTOR.get(units, 1.0)
     return cls((value, units))
コード例 #2
0
ファイル: value.py プロジェクト: swarupsahoo/dart
 def __float__(self):
     return self.value * CONV_FACTOR.get(self.units, 1.0)
コード例 #3
0
ファイル: value.py プロジェクト: Raymond0301/3rd_attempt
 def __float__(self):
     return self.value * CONV_FACTOR.get(self.units, 1.0)
コード例 #4
0
ファイル: value.py プロジェクト: Raymond0301/3rd_attempt
 def _do_op(cls, self, other, op):
     first, second = cls(self), cls(other)
     units = second.units or first.units
     value = op(float(first), float(second))
     value /= CONV_FACTOR.get(units, 1.0)
     return cls((value, units))
コード例 #5
0
ファイル: value.py プロジェクト: singingwolfboy/python-scss
    def _do_op(cls, self, other, op):
        value = op(float(self), float(other))
        value /= CONV_FACTOR.get(self.units or other.units, 1.0)

        return cls((value, self.units or other.units))