The Perl INTERCAL compiler

... INTERCAL numbers

Starting with version 1.-94, CLC-INTERCAL employs a new type of numbers, not previously found in arithmetic (this is INTERCAL, after all). The numbers are backward compatible with the unsigned integers used by older versions of CLC-INTERCAL and all the other dialects of INTERCAL; they have been extended to allow the new version number of the compiler to be a valid number.

This document defines the numbers, both in intuitive and in set-theoretic terms, and defines the meaning of the usual operations (interleave, select, etc.) when applied to INTERCAL numbers.

Introduction

All INTERCAL compilers existing before CLC-INTERCAL only understand unsigned numbers (natural numbers, for example #1, #2, #36). Other languages also support signed numbers (integers, for example #-2, #+5). It is costumary to consider unsigned numbers a subset of signed numbers, so for example #42 and #+42 are one and the same number.

CLC-INTERCAL 1.-94 break with this tradition by defining signed and unsigned integers as totally separate quantities. For example, #42 and #+42 are totally distinct entities. To be precise, #42 lies somewhere between #-42 and #+42 (but is not equal to any negative number between #-41 and #-0, or to any positive number between #+0 and #+41 - more on this fascinating subject later).

Other languages also have rational numbers. In order to avoid this concept, CLC-INTERCAL introduces lunatic numbers. A lunatic number is a sequence of INTERCAL integers, separated by their signs (if present) or by the number indicator, "#" (if the next number is unsigned). For readability, a spot (".") is allowed between consecutive numbers. For example, "1.-94" (or "1-94") is a lunatic number with two components, an unsigned 1 and a negative -94. Somewhere in this document we'll say what you can do with lunatic numbers, besides writing them down and using them to give a version number to CLC-INTERCAL.

Innatural Numbers - Intuitive definition

Innatural Numbers - Set-Theoretic definition

Lunatic Numbers - Intuitive definition

Lunatic Numbers - Set-Theoretic definition

References

[1] Ludwig Plutonium. (find references)
[2] Franco Spisani. Introduzione alla Teoria Generale dei Numeri Relativi. Seconda edizione. Bologna : Centro Superiore di Logica e Scienze Comparate, Sezione di Analisi Matematica : 1989.