logoalt Hacker News

t-writescode05/04/20252 repliesview on HN

From the doc,

  _3                  NB. negative numbers start with underscore
  _                   NB. sole underscore is infinity: a number
  __                  NB. negative infinity
Is this a standard I'm unaware of?

Replies

Avshalom05/04/2025

APL used ¯3 for negative 3; J went underscore to be similar but ascii.

avmich05/04/2025

The use of underscore for negative numbers is J's choice, explained e.g. here - https://www.jsoftware.com/docs/help807/jforc/preliminaries.h... .

Explicitly representing infinity, and working with it in some cases, allows to reduce number of exceptions...