lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2010/6/21 Adriano Saballa das Chagas <adrianosbl@hotmail.com>:
> math.between(0, 1) = 0.5
> math.between(0, 5) = 2.5
> math.between(8, 4) = 6
> math.between(3, 6) = 4.5
> math.between(8, 7) = 7.5
> math.between(0, 90) = 45
>
> That is what I want
>
>
> ________________________________
> GUARDE GRATUITAMENTE SEUS ARQUIVOS NA WEB. CLIQUE AQUI E VEJA UM PASSO A
> PASSO.

function math.between(a,b) if a<b then a,b = b,a end return ((b-a)/2)+a end

-- 
Sent from my toaster.