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
The reason is that the expression "(1:typemax(Int32))*seconds" is inefficient in terms of time and memory, because it generates a huge vector, instead of a range type.
If you want to generate a vector, then use the dot notation, i.e., "(1:3).*seconds".
This change just requires the addition of two functions, one each for the implied and explicit versions of step.
Also, the expression "(1:typemax(Int64))*seconds" generates an incorrect result, because the maximum value is converted to a float and then back to an integer. This corner case should be handled properly. Int32 works as expected.
The text was updated successfully, but these errors were encountered:
The following expression generates a vector:
julia> (1:3)*seconds
3-element Vector{AstroPeriod{AstroTime.Periods.Second, Float64}}:
1.0 seconds
2.0 seconds
3.0 seconds
I argue that it should create a new range:
julia> (1:3)*seconds
1 seconds: 1 seconds: 3 seconds
The reason is that the expression "(1:typemax(Int32))*seconds" is inefficient in terms of time and memory, because it generates a huge vector, instead of a range type.
If you want to generate a vector, then use the dot notation, i.e., "(1:3).*seconds".
This change just requires the addition of two functions, one each for the implied and explicit versions of step.
Also, the expression "(1:typemax(Int64))*seconds" generates an incorrect result, because the maximum value is converted to a float and then back to an integer. This corner case should be handled properly. Int32 works as expected.
The text was updated successfully, but these errors were encountered: