Commit 9facfcc8 by Stefan Marr

Remove unsupported bit operations on Double

Signed-off-by: Stefan Marr <git@stefan-marr.de>
1 parent 4f2392e9
......@@ -69,18 +69,6 @@ def _lessThan(ivkbl, frame, interpreter):
frame.push(rcvr.prim_less_than(right, interpreter.get_universe()))
def _and(ivkbl, frame, interpreter):
right = frame.pop()
rcvr = frame.pop()
frame.push(rcvr.prim_and(right, interpreter.get_universe()))
def _bitXor(ivkbl, frame, interpreter):
right = frame.pop()
rcvr = frame.pop()
frame.push(rcvr.prim_bit_xor(right, interpreter.get_universe()))
def _round(ivkbl, frame, interpreter):
rcvr = frame.pop()
int_value = int(round_double(rcvr.get_embedded_double(), 0))
......@@ -100,6 +88,3 @@ class DoublePrimitives(Primitives):
self._install_instance_primitive(Primitive("%", self._universe, _mod))
self._install_instance_primitive(Primitive("=", self._universe, _equals))
self._install_instance_primitive(Primitive("<", self._universe, _lessThan))
self._install_instance_primitive(Primitive("&", self._universe, _and))
self._install_instance_primitive(Primitive("bitXor:", self._universe, _bitXor))
......@@ -55,10 +55,7 @@ class Double(AbstractObject):
return universe.new_double(self._embedded_double + r)
def prim_bit_xor(self, right, universe):
l = int(self._embedded_double)
r = int(self._get_float(right))
result = float(l ^ r)
return universe.new_double(result)
raise NotImplementedError("bit operations are unsupported on double")
def prim_as_string(self, universe):
s = formatd(self._embedded_double, "g", DTSF_STR_PRECISION, DTSF_ADD_DOT_0)
......@@ -81,8 +78,7 @@ class Double(AbstractObject):
return universe.new_double(math.fmod(self._embedded_double, r))
def prim_and(self, right, universe):
r = int(self._get_float(right))
return universe.new_double(float(int(self._embedded_double) & r))
raise NotImplementedError("bit operations are unsupported on double")
def prim_equals(self, right, universe):
r = self._get_float(right)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!