Skip to content

[p5.js 2.0+ Bug Report]: min/max function with variable length parametes #9039

Description

@TakagiHitoshi

Most appropriate sub-area of p5.js?

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

p5.js version

2.3.2

Web browser and version

chrome 150.0.7871.187

Operating system

Windows 11

Steps to reproduce this

This is not an exact bug report, but a request.
min function accepts variable length parameters in p5js v.1, Now it says "Expected at most 2 arguments, but received more in min()." Would be good if compatibility would be maintained.

Steps:

  1. run a code with min(1, 2, 3, 4)

Snippet:

t=0
draw=_=>{
createCanvas(W=(w=200)2,W)+colorMode(HSB)+noFill()
for(R=0;R<w;R+=18)for(T=0;T<TAU;T+=.1)
translate(x=R
cos(U=T+t/41)+w,y=R*sin(U)+w),
rotate(t/R+U),
stroke(D=min(x,y,W-x,W-y)*2,w,w,9),
ellipse(0,0,D,D/2),
resetMatrix()
++t}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions