# Unable to convert Linspace to Range in a function

Hi all, I want to plot partitions of Riemann Sums from this blog:
https://julialang.org/blog/2017/03/piday/

The problem is since it is from 2017 article, it is using linspace, I read around and see it is replaced by range. I try to convert it and it has problem still.
[1] (::var"#23#24"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}})(i::Int64)
** @ Main ./twiceprecision.jl:0**

This is the code

``````using Plots, LaTeXStrings
gr()

f(x) = √(4 - x^2)

#plot(f, 0, 2, aspect_ratio=:equal, fill=(0, :green), alpha=0.2, label="")

function make_intervals(N=10)
xs = range(0, stop=2, length=11)
return [xs[i]..xs[i+1] for i in 1:length(xs)-1]
end

intervals = make_intervals(30)

p = plot(aspect_ratio=:equal)
for X in intervals
Y = f(X)

plot!(IntervalBox(X, Interval(0, Y.lo)), c=:blue, label="", alpha=0.1)
plot!(IntervalBox(X, Interval(Y.lo, Y.hi)), c=:red, label="", alpha=0.1)
end

plot!(f, 0, 2)

p
``````

It looks like you have a typo in your error message; it should be

``````ERROR: UndefVarError: .. not defined
``````

(You have an extra `.`.)

Anyway, the error message points to the problem:

``````return [xs[i]..xs[i+1] for i in 1:length(xs)-1]
``````

uses `..`, which is undefined. It can be defined by importing ValidatedNumerics.jl, which was imported earlier on in the blog post.

Yes it is a typo should be `..` not `...`

Thanks for pointing the package…

@StevenWhitaker

Why there occurs another error when I type:
`setdisplay(:standard, sigfigs=5)`

UndefVarError: setdisplay not defined

A different package exports `setdisplay` (not sure what one, but you could look through the blog post to see what packages are imported and see what one of those defines `setdisplay`).