From a41f2d59752753c31f0e71859f2b1ecfcf06c070 Mon Sep 17 00:00:00 2001 From: Peter Shih Date: Wed, 15 Apr 2020 15:25:37 +0800 Subject: [PATCH] Update rate range to match intceil I doubt this would change any prediction at all, but this is more correct according to the code. --- js/predictions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/predictions.js b/js/predictions.js index f0b1573..5710fb8 100644 --- a/js/predictions.js +++ b/js/predictions.js @@ -44,11 +44,11 @@ function intceil(val) { } function minimum_rate_from_given_and_base(given_price, buy_price) { - return 10000 * (given_price - 1) / buy_price; + return 10000 * (given_price - 0.99999) / buy_price; } function maximum_rate_from_given_and_base(given_price, buy_price) { - return 10000 * given_price / buy_price; + return 10000 * (given_price + 0.00001) / buy_price; } function* generate_pattern_0_with_lengths(given_prices, high_phase_1_len, dec_phase_1_len, high_phase_2_len, dec_phase_2_len, high_phase_3_len) {