gonum/floats

API behavior congruity

Closed this issue · 3 comments

The rest of gonum has the property that if a destination slice is nil, a new slice is allocated. floats does not follow this property. Should it?

If so, these are the ones that need it:
AddScaledTo
AddTo
CumProd
CumSum
DivTo
MulTo
SubTo

For reference, the primary reason floats does not match the API is that the current floats behavior is older than the establishment of the convention. The reason to keep the current behavior is that it forces users to think about efficiency when interacting with floats (users must see their allocations).

I think that given the primitives nature of floats it makes sense to not do too much. I think it's fine as it is.

Okay, that's reasonable. Wanted to mention before 1.0.