Skip to content

[p5.js 2.0 Bug Report]: if use min() and max() with Infinity or -Infinity, it throws friendly error #8104

@inaridarkfox4231

Description

@inaridarkfox4231

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.4

Web browser and version

Chrome

Operating system

Windows

Steps to reproduce this

Steps:

  1. console.log(min(Infinity,3));
  2. console.log(max(3,-Infinity));
  3. until 2.0.3, it throws no error. 2.0.4 and 2.0.5 throws friendly error. (There is no problem in getting the value.)

Snippet:

function setup() {
	createCanvas(windowWidth, windowHeight);
	background(100);
	console.log(min(Infinity,3));
	console.log(max(3,-Infinity));
}

2.0.3

no error.

Image

2.0.4, 2.0.5

friendly error occurs.

Image Image
p5.disableFriendlyErrors = true;

This might solve the problem, but most users probably don't want to go through the hassle.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions