You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the event that a version 2 is ever released, I think it would be good to have place to discuss potential design changes. Please close this issue if it's inappropriate or not worth discussing :)
To start, I think Sum(Integer) should only accept integer types. The fact that it can accept a real value and round to an integer can cause unexpected behavior, and requires extra code in OnlineStatsBase to handle that condition:
_fit!(o::Sum{T}, x::Real) where {T<:AbstractFloat} = (o.sum +=convert(T, x); o.n +=1)
_fit!(o::Sum{T}, x::Real) where {T<:Integer} = (o.sum +=round(T, x); o.n +=1) # <- this should be an error
The text was updated successfully, but these errors were encountered:
In the event that a version 2 is ever released, I think it would be good to have place to discuss potential design changes. Please close this issue if it's inappropriate or not worth discussing :)
To start, I think
Sum(Integer)
should only accept integer types. The fact that it can accept a real value and round to an integer can cause unexpected behavior, and requires extra code in OnlineStatsBase to handle that condition:The text was updated successfully, but these errors were encountered: