From c138dea9926fe5fe4148e33485ffb14bb02c7e08 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Wed, 1 May 2019 04:03:18 +0900 Subject: [PATCH] Remove int.__pow__ float handling --- vm/src/obj/objint.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vm/src/obj/objint.rs b/vm/src/obj/objint.rs index 3687ed2b0..98fc39a1b 100644 --- a/vm/src/obj/objint.rs +++ b/vm/src/obj/objint.rs @@ -13,7 +13,7 @@ use crate::pyobject::{ }; use crate::vm::VirtualMachine; -use super::objfloat::{self, PyFloat}; +use super::objfloat::PyFloat; use super::objstr::{PyString, PyStringRef}; use super::objtype; use crate::obj::objtype::PyClassRef; @@ -327,9 +327,6 @@ impl PyInt { if objtype::isinstance(&other, &vm.ctx.int_type()) { let v2 = get_value(&other).to_u32().unwrap(); vm.ctx.new_int(self.value.pow(v2)) - } else if objtype::isinstance(&other, &vm.ctx.float_type()) { - let v2 = objfloat::get_value(&other); - vm.ctx.new_float((self.value.to_f64().unwrap()).powf(v2)) } else { vm.ctx.not_implemented() }