[fix] anchoring: 앵커링가 1원 단위 내림 → 10원 단위 반올림 (자동 제안가 정돈, IMK #11 케이스)

This commit is contained in:
Mina Choi 2026-07-29 09:51:26 +09:00
parent a56589c6d9
commit f554202c58
2 changed files with 5 additions and 5 deletions

View File

@ -25,8 +25,8 @@ def calc_price_range_index(target_price: int) -> int:
def calc_anchoring_price(target_price: int, anchoring_value: int) -> int: def calc_anchoring_price(target_price: int, anchoring_value: int) -> int:
"""앵커링가 = 목표가 × (1 A), 1원 단위 내림. §4.2 (정수 연산만)""" """앵커링가 = 목표가 × (1 A), 10원 단위 반올림. §4.2 (정수 연산만)"""
return target_price * (1000 - anchoring_value) // 1000 return (target_price * (1000 - anchoring_value) + 5000) // 10000 * 10
def judge_sample_type( def judge_sample_type(

View File

@ -23,10 +23,10 @@ E = AnchoringSampleType.EXCLUDED.value
# ── §11.1 앵커링가 계산 (내림 검증) ────────────────────── # ── §11.1 앵커링가 계산 (내림 검증) ──────────────────────
def test_calc_anchoring_price_floor(): def test_calc_anchoring_price_round():
assert calc_anchoring_price(30_000, 200) == 24_000 assert calc_anchoring_price(30_000, 200) == 24_000
assert calc_anchoring_price(26_706, 10) == 26_438 # 26,438.94 → 내 assert calc_anchoring_price(26_706, 10) == 26_440 # 26,438.94 → 10원 반올
assert calc_anchoring_price(29_999, 15) == 29_549 # 29,549.015 → 내 assert calc_anchoring_price(29_999, 15) == 29_550 # 29,549.015 → 10원 반올
assert calc_anchoring_price(0, 10) == 0 assert calc_anchoring_price(0, 10) == 0