Most appropriate sub-area of p5.js?
p5.js version
Latest main branch (development version from the repository)
Web browser and version
All browsers — issue is in core math logic, not rendering
Operating system
macOS (development environment)
Steps to reproduce this
Steps:
- Call map() with a collapsed input range (start1 === stop1)
- Example: map(5, 10, 10, 0, 100)
- The result becomes Infinity or NaN due to division by zero
Snippet:
// This produces Infinity or NaN:
let x = map(5, 10, 10, 0, 100);
console.log(x); // Infinity or NaN