July 4th, 2024

Common Lisp Names All Sixteen Binary Logic Gates

The section on Logical Operations in Common Lisp covers using integers for logical operations, representing bit vectors as sets. Functions like logior, logand, and logxor compute set operations efficiently.

Read original articleLink Icon
Common Lisp Names All Sixteen Binary Logic Gates

The section on Logical Operations on Numbers in Common Lisp focuses on using integers for logical operations, treating them as if in two's-complement notation. These operations provide a way to represent bit vectors and sets, mapping sets into non-negative integers. Functions like logior, logand, and logxor compute union, intersection, and symmetric difference on sets represented as bit vectors. Additional functions like boole and lognot offer various logical operations on integers. The logcount function determines the number of bits in an integer, considering its binary representation. The integer-length function calculates the minimum number of bits needed to represent an integer in binary form, considering its sign. These functions provide a comprehensive set of tools for performing logical operations and manipulating numbers efficiently in Common Lisp.

Related

Cognate: Readable and concise concatenative programming

Cognate: Readable and concise concatenative programming

Cognate is a concise, readable concatenative programming language emphasizing simplicity and flexibility. It supports operators as functions, stack evaluation, control flow statements, list manipulation, recursion, and mutable variables through boxes.

How does a computer/calculator compute logarithms?

How does a computer/calculator compute logarithms?

Computers and calculators compute logarithms using geometric series and polynomial equations from calculus. Natural logarithm's relation to $\frac{1}{1+x}$ is explained through curve areas. Polynomial series derived from integrating geometric series compute natural logarithms, but converge quickly only for $|x| < \frac{1}{2}."

Identifying Leap Years (2020)

Identifying Leap Years (2020)

David Turner explores optimizing leap year calculations for performance gains by using bitwise operations and integer bounds. He presents efficient methods, mathematical proofs, and considerations for signed integers, highlighting limitations pre-Gregorian calendar.

A brief introduction to interval arithmetic

A brief introduction to interval arithmetic

Interval arithmetic deals with uncertainties by using intervals instead of exact numbers. It offers accuracy in calculations but faces challenges like complexities and overestimation. Despite evolving, it finds applications in diverse fields.

What makes e natural? (2004)

What makes e natural? (2004)

The number e in mathematics, introduced by Euler, has unique properties like transcendence and relation to trigonometric functions. Historical figures like Bürgi, Napier, and Briggs contributed to logarithmic advancements. E's significance lies in its role in exponential and logarithmic functions, crucial in calculus.

Link Icon 2 comments
By @smegsicle - 3 months
your language doesnt?