Jump to content

Averages/Pythagorean means: Difference between revisions

m
→‎{{header|Phix}}: iff went builtin in 2016!
(Update to work with version 1.4 of Nim. Changed the output to match the actual format.)
m (→‎{{header|Phix}}: iff went builtin in 2016!)
Line 2,436:
 
=={{header|Phix}}==
(note to self: iff should really be a builtin)
<lang Phix>function arithmetic_mean(sequence s)
return sum(s)/length(s)
Line 2,457 ⟶ 2,456:
end function
function iff(integer condition, object Tval, object Fval)
if condition then return Tval else return Fval end if
end function
 
constant s = {1,2,3,4,5,6,7,8,9,10}
constant arithmetic = arithmetic_mean(s),
7,806

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.