User talk:Dedalus: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
(alternative)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== else rqd ===
=== else rqd ===
In [[Fivenum]] you wrote (VBA/<nowiki>{{trans|Phix}}</nowiki>)
In [[Fivenum#VBA]] you wrote (<nowiki>{{trans|Phix}}</nowiki>)
If l Mod 2 = 1 Then
If l Mod 2 = 1 Then
median = tbl(m)
median = tbl(m)
Line 11: Line 11:
median = (tbl(m - 1) + tbl(m)) / 2
median = (tbl(m - 1) + tbl(m)) / 2
End If
End If
Dear mister Lomax, you are perfectly right. [[User:Dedalus|Dedalus]] ([[User talk:Dedalus|talk]]) 18:14, 11 February 2019 (UTC) An alternative would be to include a line 'exit sub' after the line 'median = tbl(m)'.

Latest revision as of 18:20, 11 February 2019

else rqd

In Fivenum#VBA you wrote ({{trans|Phix}})

   If l Mod 2 = 1 Then
       median = tbl(m)
   End If
   median = (tbl(m - 1) + tbl(m)) / 2

to match the Phix output I think that should be

   If l Mod 2 = 1 Then
       median = tbl(m)
   Else
       median = (tbl(m - 1) + tbl(m)) / 2
   End If

Dear mister Lomax, you are perfectly right. Dedalus (talk) 18:14, 11 February 2019 (UTC) An alternative would be to include a line 'exit sub' after the line 'median = tbl(m)'.