processing / processing/processing-website

Equality operator fails with NaN

Open
#381 4 comments 0 reactions 1 assignee View on GitHub

@REAS is already working on this.

Since Jun 3, 2020.

Dominant language
MDX
Stars
90
Forks
122
Avg merge
1h 43m
Merged PRs (30d)
3

Description

Issue description

"==" operator fail with NaN confuses beginners

float result = float(s); // String s = "something wrong"
println(result); // prints NaN
if (result == Float.NaN) throw new Exception("Float error"); // does not throw exception

Proposed fix

maybe add correct syntax proposal (Float.isNaN) to language description, section Equality

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.