From 3e9a4296b782ec3933952cbecfc520695132cff6 Mon Sep 17 00:00:00 2001 From: ParkChangho Date: Thu, 30 Nov 2017 16:26:07 +0900 Subject: [PATCH] correct itoh function in test.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit btree 플래그 연산에 있어 "0xFFFF"같이 6자리로 되어야 연산이 됩니다. 그래서 기존의 int를 hex형식의 flag로 바꿔주는 itoh함수를 0xFFFF의 형태로 바꿀 수 있도록 변경했습니다. --- test.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test.py b/test.py index 29c3d78..5b50e79 100644 --- a/test.py +++ b/test.py @@ -190,14 +190,10 @@ # TEST 4: btree # ##################################################################################################### +# int to hex format:"0xFFFF" def itoh(i): h = hex(i) - if len(h) % 2 == 1: - h = '0x0%s' % h[2:].upper() - else: - h = '0x%s' % h[2:].upper() - - return h + return '0x'+('0'*(6-len(h)))+h[2:].upper()