# What does it mean x=-3:0.1:3?

**URL:** <https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [February 1, 2021, 4:34pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394 "2021-02-01T16:34:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Volodymyr\_Pakholok](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/volodymyr_pakholok/32/21600_2.png) [@Volodymyr\_Pakholok](https://discourse.julialang.org/u/Volodymyr_Pakholok)\
**Post date:** [February 1, 2021, 4:34pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394/1 "2021-02-01T16:34:21Z")

</div>

what does it mean x = -3:0.1:3 ? How it works?

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 1, 2021, 4:43pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394/2 "2021-02-01T16:43:49Z")

</div>

Hi @Volodymyr_Pakholok, welcome to our forum. Please take time to format your questions and their titles appropriately. I have already corrected your prior post — please use that as a template/inspiration to edit this post.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 1, 2021, 4:54pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394/3 "2021-02-01T16:54:47Z")

</div>

For more details about asking questions here, see [PSA: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

I’ve unlisted this thread for now. Once the title is edited, I’ll be happy to restore it.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 1, 2021, 4:54pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394/4 "2021-02-01T16:54:52Z")

</div>



---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [February 1, 2021, 7:35pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394/5 "2021-02-01T19:35:45Z")

</div>



---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 1, 2021, 8:13pm UTC](https://discourse.julialang.org/t/what-does-it-mean-x-3-0-1-3/54394/6 "2021-02-01T20:13:05Z")

</div>

This is shorthand notation for a range from -3 to 3 (inclusive), with steps of size 0.1, i.e.:

```julia
julia> collect(-3:0.1:3)
61-element Vector{Float64}:
 -3.0
 -2.9
 -2.8
 -2.7
  ⋮
  2.7
  2.8
  2.9
  3.0

```

Here, I’ve used `collect` to create a vector with every element of the range in it, however most of the time you don’t actually need to do this - it is more efficient to just work with the range, which only stores start and end point and stepsize:

```julia
julia> fieldnames(typeof(-3.0:0.1:3.0))
(:ref, :step, :len, :offset)

```

This allows you to create very large ranges at no extra cost:

```julia
julia> x = 1e10:0.1:1e15
1.0e10:0.1:1.0e15

julia> length(x)
9999900000000001

```

Here I’ve created a range that holds way more elements than I could fit in memory as Float64 - if I need any of them, they will be calculated on the fly:

```julia
julia> x[1_234_456_789]
1.01234456788e10

```
