# Perlin noise range does not go all the way from 0.0 - 1.0

**URL:** <https://discourse.processing.org/t/perlin-noise-range-does-not-go-all-the-way-from-0-0-1-0/45722>\
**Category:** Coding Questions\
**Created:** [February 7, 2025, 10:12am UTC](https://discourse.processing.org/t/perlin-noise-range-does-not-go-all-the-way-from-0-0-1-0/45722 "2025-02-07T10:12:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomToad](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@TomToad](https://discourse.processing.org/u/TomToad)\
**Post date:** [February 7, 2025, 10:12am UTC](https://discourse.processing.org/t/perlin-noise-range-does-not-go-all-the-way-from-0-0-1-0/45722/1 "2025-02-07T10:12:27Z")

</div>

I realize that the noise() function won’t go all the way to 1.0, but I’d think that it would at least get as high as 0.999, but it only reaches around 0.846, and it only goes down to about 0.0735. That means when I’m plotting random x,y values based on noise(), the x and y never reaches the edges.  
In my example below, the plot never reaches the edges. It clumps around the center, which is what I expect and actually want, but I get nothing on the edge. Right now I fix the problem with map(noise(time),0.1,0.8,0,width-1) and constrain the result between 0 and width-1 for the few times it runs outside that range.  
Is there a better way to handle this? Is noise() bugged or is this expected with Perlin noise?  
.

```auto
float minNoiseX = 1;
float maxNoiseX = 0;
float minNoiseY = 1;
float maxNoiseY = 0;
float noiseX, noiseY;

void setup() {
  size(800,800);
  background(255);
}

void draw() {
  stroke(0);
  for(int i = 0; i < 1000; i++) {
    noiseX = noise(random(1000));
    noiseY = noise(random(1000));
    if(noiseX < minNoiseX) minNoiseX = noiseX;
    if(noiseX > maxNoiseX) maxNoiseX = noiseX;
    if(noiseY < minNoiseY) minNoiseY = noiseY;
    if(noiseY > maxNoiseY) maxNoiseY = noiseY;
    point(noiseX*width,noiseY*height);
  }
}

void mouseClicked() {
  println("minNoiseX = "+str(minNoiseX)+" : minNoiseY = "+str(minNoiseY));
  println("maxNoiseX = "+str(maxNoiseX)+" : maxNoiseY = "+str(maxNoiseY));
}

```

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 7, 2025, 11:08am UTC](https://discourse.processing.org/t/perlin-noise-range-does-not-go-all-the-way-from-0-0-1-0/45722/2 "2025-02-07T11:08:22Z")

</div>

**Random function**

- provides a random number in the range 0≤ n \<1 and
- random numbers are evenly distributed over this range  
This means that the chance of getting 0.001, 0.5 or 0.9999 are all equally likely.

**Noise function**

- provides a number in the range 0≤ n \<1
- numbers are related to previous value obtained
- numbers are _close_ + or - to the previous value obtained  
This means to get a value close to 1 is _ **extremely** _ rare because it requires the numbers to get bigger much more often than get smaller.

> [@TomToad](#):
>
> is this expected with Perlin noise?

So the answer is Yes 😁
