-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Ranges with eltype Rational work OK in base 2
julia> onetwo(1//8, 8)
7-element OneTwoFive.Struct{Rational{Int64}, 2, 1}:
1//8, 1//4, 1//2, 1//1, 2//1, 4//1, 8//1... but are quite ugly in base 10:
julia> x10 = onetwofive(1//10, 10)
7-element OneTwoFive.Struct{Rational{Int64}, 10, 3}:
3602879701896397//36028797018963968 … 1//2, 1//1, 2//1, 5//1, 10//1
julia> dump(x10)
OneTwoFive.Struct{Rational{Int64}, 10, 3}
off: Int64 -3
len: Int64 7
julia> float(x10)
7-element OneTwoFive.Struct{Float64, 10, 3}:
0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0
julia> x10 .+ 0.0
7-element Vector{Float64}:
0.1
0.2
0.5
1.0
2.0
5.0
10.0Metadata
Metadata
Assignees
Labels
No labels