K
Kejpa
Hi,
I have a function Sum as....
Function Sum(ByVal ParamArray Values() As Double) As Double
Dim rSum, itm As Double
For Each itm In Values
rSum += itm
Next
Return rSum
End Function
This function is general enough I think, but troubles arise when I try to
calculate the sum of an array of singles. Do I really have to make an
overloaded function for single, long, integer, short, byte and whatnot?
Or is there a better approach?
TIA
/Kejpa
I have a function Sum as....
Function Sum(ByVal ParamArray Values() As Double) As Double
Dim rSum, itm As Double
For Each itm In Values
rSum += itm
Next
Return rSum
End Function
This function is general enough I think, but troubles arise when I try to
calculate the sum of an array of singles. Do I really have to make an
overloaded function for single, long, integer, short, byte and whatnot?
Or is there a better approach?
TIA
/Kejpa