Skip to content

Conversation

@FeudalDiana
Copy link

Rendered

Proposal to add:

math.isnan(x: number): boolean
math.isinf(x: number): boolean
math.isfinite(x: number): boolean

@jackdotink
Copy link
Contributor

I don't think both isinf and isfinite are needed.

@aatxe
Copy link
Contributor

aatxe commented Oct 6, 2025

Can you please linewrap the markdown file so that we can leave comments in a targeted way? 80 or 100 or even 120 columns is fine.

@FeudalDiana
Copy link
Author

@aatxe Done 😄

@vegorov-rbx
Copy link
Collaborator

It's very common for language math APIs to have both isinf and isfinite.

@deviaze
Copy link

deviaze commented Oct 6, 2025

Could we also support vectors here?

  • math.isnan(v: vector) returns true iff any component of the vector is NaN, similar to how v ~= v already works.

  • math.isinf(v: vector) returns true iff any component of the vector is +/- math.huge

  • math.isfinite(v: vector) returns true iff every component of the vector is finite

@FeudalDiana
Copy link
Author

Could we also support vectors here?

  • math.isnan(v: vector) returns true iff any component of the vector is NaN, similar to how v ~= v already works.
  • math.isinf(v: vector) returns true iff any component of the vector is +/- math.huge
  • math.isfinite(v: vector) returns true iff every component of the vector is finite

Feels like this would be better to implement inside of the vector library, going off existing convention (math.max, vector.max etc). Perhaps in a separate RFC?

@aatxe
Copy link
Contributor

aatxe commented Oct 7, 2025

Yeah, I don't think we need to talk about vector support for functions in what is effectively the number library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants