Skip to content

Commit

Permalink
Use ndigits instead of Base.top_set_bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sostock committed May 3, 2024
1 parent 9db361e commit 1e4be53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function broadcasted(::DefaultArrayStyle{1}, x::BCAST_PROPAGATE_CALLS, r::StepRa
astop = ustrip(au_from, r.stop)
len = length(r)
offset = _offset_for_steprangelen(astart, astop, len)
nb = Base.top_set_bit(max(offset-1, len-offset))
nb = ndigits(max(offset-1, len-offset), base=2, pad=0)
T = promote_type(numtype(start), numtype(step))
unitless_range = Base.steprangelen_hp(T, ustrip(au_to, r[offset]), ustrip(au_to, step), nb, len, offset)
return unitless_range * unit(start)
Expand Down

0 comments on commit 1e4be53

Please sign in to comment.