(Translated by https://www.hiragana.jp/)
emacs:brb: update qpr formula · d12frosted/environment@5565367 · GitHub
Skip to content

Commit

Permalink
emacs:brb: update qpr formula
Browse files Browse the repository at this point in the history
  • Loading branch information
d12frosted committed Sep 16, 2024
1 parent e9488a0 commit 5565367
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions emacs/lisp/lib-brb.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,21 @@ PRICE is a positive number in `brb-currency'.
VOLUME is a positive number in ml (default 750).
QPR is adjusted to account for VOLUME."
(when (and score price (> price 0))
(when (and score price (> price 0) (> score 0))
(setq volume (or volume 750))
(setq price (* price (/ 750.0 volume)))
(setq p (calc-from-number (float price)))
(setq s (calc-from-number (float score)))
(calc-to-number
(math-div
(math-mul
1400
(math-mul (math-pow (calcFunc-fact s) (math-add 1 (math-phi)))
(calcFunc-ln (math-add (calc-from-number 1.1) s))))
p))))

(math-sqrt
(math-div
(math-mul
1400
(math-mul (math-pow (calcFunc-fact s) (math-add 1 (math-phi)))
(calcFunc-ln (math-add (calc-from-number 1.1) s))))
p))
100))))

;; * Candidates for deletion

Expand Down

0 comments on commit 5565367

Please sign in to comment.