• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
          • Df
          • Unsigned-byte-p
          • Posp
          • Natp
          • <
          • +
          • Bitp
          • Zero-test-idioms
          • Nat-listp
          • Integerp
          • *
          • -
          • Zp
          • Signed-byte-p
          • Logbitp
          • Sharp-f-reader
          • Expt
          • <=
          • Ash
          • Rationalp
          • =
          • Nfix
          • Logand
          • Floor
          • Random$
          • Integer-listp
          • Complex
          • Numbers-introduction
          • Truncate
          • Code-char
          • Char-code
          • Integer-length
          • Zip
          • Logior
          • Sharp-u-reader
          • Mod
          • Unary--
          • Boole$
          • /
          • Logxor
          • Ifix
          • Lognot
          • Integer-range-p
          • Allocate-fixnum-range
          • ACL2-numberp
          • Sharp-d-reader
          • Mod-expt
          • Ceiling
          • Round
          • Logeqv
          • Fix
          • Explode-nonnegative-integer
          • Max
          • Evenp
          • Zerop
          • Abs
          • Nonnegative-integer-quotient
          • Rfix
          • 1+
          • Pos-listp
          • Signum
          • Rem
          • Real/rationalp
          • Rational-listp
          • >=
          • >
          • Logcount
          • ACL2-number-listp
          • /=
          • Unary-/
          • Realfix
          • Complex/complex-rationalp
          • Logtest
          • Logandc1
          • Logorc1
          • Logandc2
          • Denominator
          • 1-
          • Numerator
          • Logorc2
          • The-number
          • Int=
          • Complex-rationalp
          • Min
          • Lognor
          • Zpf
          • Oddp
          • Minusp
          • Lognand
          • Imagpart
          • Conjugate
          • Realpart
          • Plusp
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
        • Program-wrapper
        • Get-internal-time
        • Basics
        • Packages
        • Oracle-eval
        • Defmacro-untouchable
        • <<
        • Primitive
        • Revert-world
        • Unmemoize
        • Set-duplicate-keys-action
        • Symbols
        • Def-list-constructor
        • Easy-simplify-term
        • Defiteration
        • Fake-oracle-eval
        • Defopen
        • Sleep
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Programming

Numbers

Numbers in ACL2 and operations on them

See numbers-introduction for introductory background. See arithmetic for libraries of books for arithmetic reasoning.

Subtopics

Df
Support for floating-point operations
Unsigned-byte-p
Recognizer for natural numbers that fit in a specified bit width
Posp
A recognizer for the positive integers
Natp
A recognizer for the natural numbers
<
Less-than
+
Addition macro
Bitp
A recognizer for the set of bits, {0,1}
Zero-test-idioms
How to test for 0
Nat-listp
Recognizer for a true list of natural numbers
Integerp
Recognizer for whole numbers
*
Multiplication macro
-
Macro for subtraction and negation
Zp
Testing a ``natural'' against 0
Signed-byte-p
Recognizer for signed integers that fit in a specified bit width
Logbitp
The ith bit of an integer
Sharp-f-reader
Read a rational number in floating-point syntax
Expt
Exponential function
<=
Less-than-or-equal test
Ash
Arithmetic shift operation
Rationalp
Recognizer for rational numbers (ratios and integers)
=
Test equality of two numbers
Nfix
Coerce to a natural number
Logand
Bitwise logical `and' of zero or more integers
Floor
Division returning an integer by truncating toward negative infinity
Random$
Obtain a random value
Integer-listp
Recognizer for a true list of integers
Complex
Create an ACL2 number
Numbers-introduction
Numbers in ACL2
Truncate
Division returning an integer by truncating toward 0
Code-char
The character corresponding to a given numeric code
Char-code
The numeric code for a given character
Integer-length
Number of bits in two's complement integer representation
Zip
Testing an ``integer'' against 0
Logior
Bitwise logical inclusive or of zero or more integers
Sharp-u-reader
Allow underscore characters in numbers
Mod
Remainder using floor
Unary--
Arithmetic negation function
Boole$
Perform a bit-wise logical operation on 2 two's complement integers
/
Macro for division and reciprocal
Logxor
Bitwise logical exclusive or of zero or more integers
Ifix
Coerce to an integer
Lognot
Bitwise not of a two's complement number
Integer-range-p
Recognizer for integers between two bounds.
Allocate-fixnum-range
Set aside fixnums in GCL
ACL2-numberp
Recognizer for numbers
Sharp-d-reader
Read a rational number as a representable rational (see df)
Mod-expt
Exponential function
Ceiling
Division returning an integer by truncating toward positive infinity
Round
Division returning an integer by rounding off
Logeqv
Bitwise logical equivalence of zero or more integers
Fix
Coerce to a number
Explode-nonnegative-integer
The list of characters in the radix-r form of a number
Max
The larger of two numbers
Evenp
Test whether an integer is even
Zerop
Test an acl2-number against 0
Abs
The absolute value of a real number
Nonnegative-integer-quotient
Natural number division function
Rfix
Coerce to a rational number
1+
Increment by 1
Pos-listp
Recognizer for a true list of positive integers
Signum
Indicator for positive, negative, or zero
Rem
Remainder using truncate
Real/rationalp
Recognizer for rational numbers (including real number in ACL2(r))
Rational-listp
Recognizer for a true list of rational numbers
>=
Greater-than-or-equal test
>
Greater-than test
Logcount
Number of ``on'' bits in a two's complement number
ACL2-number-listp
Recognizer for a true list of numbers
/=
Test inequality of two numbers
Unary-/
Reciprocal function
Realfix
Coerce to a real number
Complex/complex-rationalp
Recognizer for complex numbers
Logtest
Test if two integers share a `1' bit
Logandc1
Bitwise logical `and' of two ints, complementing the first
Logorc1
Bitwise logical inclusive or of two ints, complementing the first
Logandc2
Bitwise logical `and' of two ints, complementing the second
Denominator
Divisor of a ratio in lowest terms
1-
Decrement by 1
Numerator
Dividend of a ratio in lowest terms
Logorc2
Bitwise logical inclusive or of two ints, complementing the second
The-number
Coerce an expected number to a number
Int=
Test equality of two integers
Complex-rationalp
Recognizes complex rational numbers
Min
The smaller of two numbers
Lognor
Bitwise logical `nor' of two integers
Zpf
Testing a nonnegative fixnum against 0
Oddp
Test whether an integer is odd
Minusp
Test whether a number is negative
Lognand
Bitwise logical `nand' of two integers
Imagpart
Imaginary part of a complex number
Conjugate
Complex number conjugate
Realpart
Real part of a complex number
Plusp
Test whether a number is positive