Value NaN of a variable

please repair your above code posting first.


i asked you to try one line of code to understand the floating point number range
what was the result?
is there a number type that can cover a bigger number range? YES “double”
would it help in your case / math ? i think NOT


yes there are books,
but also

all might depend of YOUR best way of learning.


the problem is that from you code it is not clear
what you want to do?

  • -1- cover the canvas with points and find some nice way to color them?
  • -2- use 20 000 000 points to draw some structure on the canvas ?spiral?..

so for -1-:
show a easy start:

void setup() {
  size(500, 500);
  colorMode(HSB, width, 100, 100);
}

void draw() {
  many_points();
}

void many_points() {
  for ( int x = 0; x < width; x++)
    for ( int y = 0; y < height; y++ ) {
      stroke(x, 100, 100);
      point(x, y);
    }
}

2 Likes