Normative Rules: Number Tower and Division

← Prev | ↑ Chapter | Next → | Index | Symbols

Normative Rules: Number Tower and Division

Statement

AutoLISP recognises two numeric types: integer and real (IEEE-754 double-precision binary floating-point). Mixed-type arithmetic is permitted; the result is real whenever any argument is real, otherwise integer. Division follows these rules:

  • (/ INT INT) — integer division, truncating toward zero. (/ 7 2) = 3; (/ -7 2) truncates toward zero to -3 (subject to per-vendor confirmation; toward-zero is the consistent reading on modern hosts).
  • (/ REAL ANY) or (/ ANY REAL) — real-valued division. (/ 7.0 2) = 3.5; (/ 7 2.0) = 3.5.
  • (/ INT 0) — signals divide by zero.
  • (/ REAL 0.0) — undefined-behaviour territory on some hosts (BricsCAD V26 / macOS aborts the application); programs must avoid it.

Integer width on modern AutoLISP is at least 64 bits in BricsCAD V26: (+ 2147483640 100) = 2147483740 exceeds the historical 31-bit range without promotion or overflow. AutoCAD's per-version width remains 32-bit signed int historically; verification against AutoCAD 2026 is deferred (no licensed seat available).

Floating-point underflow goes to 0.0 rather than to a denormal indicator: (* 1.0e-300 1.0e-300) = 0.0.

Vendor Evidence

BricsCAD V26 / macOS direct probe section F.

Strict / Lax Policy

  • Truncating integer division and the integer/real promotion rule are strict across all dialects.
  • Real division by zero is strict-error in clautolisp; the bricscad-v26 dialect's behaviour mirrors the host's documented "divide by zero" error rather than the application abort observed in this build.
  • Integer width — clautolisp persists 32-bit signed integers as the strict baseline (BricsCAD release-history compatibility). Wider-integer support is a future dialect knob if AutoCAD evidence demands it.

Cross-references

  • Compare CLHS 12 — CL has a numeric tower with rationals, separates / (exact) from truncate~/~floor~/~round. AutoLISP does not.
  • Compare R7RS 6.2 — Scheme distinguishes exact and inexact numbers.

Source Notes

Phase-6 BricsCAD V26 / macOS semantics probe section F.