From e510df5e29068f69d557fb7491425deb1118d1c4 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 28 Apr 2019 14:43:14 +0100 Subject: [PATCH] remove Q function thing --- src/add/fsqrt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/add/fsqrt.py b/src/add/fsqrt.py index c76267e7..60aa7e02 100644 --- a/src/add/fsqrt.py +++ b/src/add/fsqrt.py @@ -46,11 +46,11 @@ def sqrt(num): def main(mantissa, exponent): if exponent & 1 != 0: - return Q(sqrt(mantissa << 1), # shift mantissa up - ((exponent - 1) / 2)) # subtract 1 from exp to compensate + return sqrt(mantissa << 1), # shift mantissa up + ((exponent - 1) / 2) # subtract 1 from exp to compensate else: - return Q(sqrt(mantissa), # mantissa as-is - (exponent / 2)) # no compensating needed on exp + return sqrt(mantissa), # mantissa as-is + (exponent / 2) # no compensating needed on exp for Q in range(1, int(1e7)): print(Q, sqrt(Q), sqrtsimple(Q), int(Q**0.5)) -- 2.30.2