Skip to content

max() crashes on long arrays #6101

@sgcrews

Description

@sgcrews

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
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.5.0

Web browser and version

Operating System

Windows 10 22H2

Steps to reproduce this

Steps:

  1. Create a simple 1D array of floats of length > ~ 126,000
  2. Pass the array as argument to max()
  3. "Maximum call stack size exceeded" error is reported

Snippet:

// Paste your code here :)
  const m = new Array(126000);
  let myMax = max(m);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions