Quick question :)

User avatar
alkapin
Ник удалён за неоплаченную рекламу
Posts: 391
Joined: 15 May 2002 09:16
Location: было оттуда, теперь отсюда

Quick question :)

Post by alkapin »

I have 3 variables:

a - current rating of item
b - total number of votes for this particular item
c - new rating to update current rating with

Something has rating of a, and total number of votes b. Someone just rated this something at c. I need to recalculate rating a considering new rating c.

"Среднее арифм." obviously wouldn't do it.

Anyone? :mrgreen:
User avatar
KVA
Уже с Приветом
Posts: 5347
Joined: 03 Feb 1999 10:01
Location: NJ, USA

Post by KVA »

dup ..
Last edited by KVA on 15 Dec 2003 02:44, edited 1 time in total.
User avatar
KVA
Уже с Приветом
Posts: 5347
Joined: 03 Feb 1999 10:01
Location: NJ, USA

Post by KVA »

((a*b)+c)/(b+1)
User avatar
alkapin
Ник удалён за неоплаченную рекламу
Posts: 391
Joined: 15 May 2002 09:16
Location: было оттуда, теперь отсюда

Post by alkapin »

KVA wrote:((a*b)+c)/(b+1)


Спасибо.

Return to “Вопросы и новости IT”