The IEEE Standard for Floating-Point Arithmetic ( IEEE 754 ) is the most widely-used standard for floating-point computation, and is followed by many hardware (CPU and FPU) and software implementations. Many computer languages allow or require that some or all arithmetic be carried out using IEEE 754 formats and operations. The current version is IEEE 754-2008, which was published in August 2008; it includes nearly all of the original IEEE 754-1985 (which was published in 1985) and the IEEE Standard for Radix-Independent Floating-Point Arithmetic (IEEE 854-1987).

The standard defines

  • arithmetic formats: sets of binary and decimal floating-point data, which consist of finite numbers (including signed zeros and subnormal numbers), infinities, and special 'not a number' values (NaNs)
  • interchange formats: encodings (bit strings) that may be used to exchange floating-point data in an efficient and compact form
  • rounding algorithms: methods to be used for rounding numbers during arithmetic and conversions
  • operations: arithmetic and other operations on arithmetic formats
  • exception handling: indications of exceptional conditions (such as division by zero, overflow, etc. )

The standard also includes extensive recommendations for advanced exception handling, additional operations (such as trigonometric functions), expression evaluation, and for achieving reproducible results.

The standard is derived from and replaces IEEE 754-1985, the previous version, following a seven-year revision process, chaired by Dan Zuras and edited by Mike Cowlishaw. The binary formats in the original standard are included in the new standard along with three new basic formats (one binary and two decimal). To conform to the current standard, an implementation must implement at least one of the basic formats as both an arithmetic format and an interchange format.

Formats

Formats in IEEE 754 describe sets of floating-point data and encodings for interchanging them.

A given format comprises:

  • Finite numbers, which may be either base 2 (binary) or base 10 (decimal). Each finite number is most simply described by three integers: a sign (zero or one), s , a significand (or 'coefficient'), c , and an exponent , q . The numerical value of a finite number is
      (−1) s × c × b q
    where b is the base (2 or 10). For example, if the sign is 1 (indicating negative), the significand is 12345, the exponent is −3, and the base is 10, then the value of the number is −12.345.
  • Two infinities: +∞ and −∞.
  • Two kinds of NaN (quiet and signaling). A NaN may also carry a payload , intended for diagnostic information indicating the source of the NaN. The sign of a NaN has no meaning, but it may be predictable in some circumstances.

The possible finite values that can be represented in a given format are determined by the base ( b ), the number of digits in the significand (precision, p ), and the exponent parameter emax :

  • c must be an integer in the range zero through b p −1 ( e.g. , if b =10 and p =7 then c is 0 through 9999999)
  • q must be an integer such that 1− emax q + p −1 ≤ emax ( e.g. , if p =7 and emax =96 then q is −101 through 90).

Hence (for the example parameters) the smallest non-zero positive number that can be represented is 1×10 −101 and the largest is 9999999×10 90 (9.999999×10 96 ), and the full range of numbers is −9.999999×10 96 through 9.999999×10 96 . The numbers closest to the inverse of these bounds (−1×10 −95 and 1×10 −95 ) are considered to be the smallest (in magnitude) normal numbers ; non-zero numbers between these smallest numbers are called subnormal numbers.

Zero values are finite values with significand 0. These are signed zeros, the sign bit specifies if a zero is +0 (positive zero) or −0(negative zero).

Basic formats

The standard defines five basic formats, named using their base and the number of bits used to encode them. A conforming implementation must fully implement at least one of the basic formats. There are three binary floating-point basic formats (which can be encoded using 32, 64 or 128 bits) and two decimal floating-point basic formats (which can be encoded using 64 or 128 bits). The binary32 and binary64 formats are the single and double formats of IEEE 754-1985.

The precision of the binary formats is one greater than the width of its significand, because there is an implied (hidden) 1 bit.

All the basic formats are available in both hardware and software implementations.

Arithmetic formats

A format that is just to be used for arithmetic and other operations need not have an encoding associated with it (that is, an implementation can use whatever internal representation it chooses); all that needs to be defined are its parameters ( b , p , and emax ). These parameters uniquely describe the set of finite numbers (combinations of sign, significand, and exponent) that it can represent.

Interchange formats

Interchange formats are intended for the exchange of floating-point data using a fixed-length bit-string for a given format.

For the exchange of binary floating-point numbers, interchange formats of length 16 bits, 32 bits, 64 bits, and any multiple of 32 bits ≥128 are defined. The 16-bit format is intended for the exchange or storage of small numbers ( e.g. , for graphics).

The encoding scheme for these binary interchange formats is the same as that of IEEE 754-1985: a sign bit, followed by w exponent bits that describe the exponent offset by a bias , and p −1 bits that describe the significand. The width of the exponent field for a k -bit format is computed as w  = round(4×log2( k ))−13. The existing 64- and 128-bit formats follow this rule, but the 16- and 32-bit formats have more exponent bits (5 and 8) than this formula would provide (3 and 7, respectively).

As with IEEE 754-1985, there is some flexibility in the encoding of signaling NaNs.

For the exchange of decimal floating-point numbers, interchange formats of any multiple of 32 bits are defined.

The encoding scheme for the decimal interchange formats similarly encodes the sign, exponent, and significand, but uses a more complex approach to allow the significand to be encoded as a compressed sequence of decimal digits (using Densely Packed Decimal) or as a binary integer. In either case the set of numbers (combinations of sign, significand, and exponent) that may be encoded is identical, and signaling NaNs have a unique encoding (and the same set of possible payloads).

Rounding algorithms

The standard defines five rounding algorithms. The first two round to a nearest value; the others are called directed roundings :

Roundings to nearest

  • Round to nearest, ties to even – rounds to the nearest value; if the number falls midway it is rounded to the nearest value with an even (zero) least significant bit, which occurs 50% of the time; this is the default algorithm for binary floating-point and the recommended default for decimal
  • Round to nearest, ties away from zero – rounds to the nearest value; if the number falls midway it is rounded to the nearest value above (for positive numbers) or below (for negative numbers)

Directed roundings

  • Round toward 0 – directed rounding towards zero (also called truncation)
  • Round toward +∞ – directed rounding towards positive infinity
  • Round toward −∞ – directed rounding towards negative infinity.

Operations

Required operations for a supported arithmetic format (including the basic formats) include:

  • Arithmetic operations (add, subtract, multiply, divide, square root, fused-multiply-add, remainder, etc. )
  • Conversions (between formats, to and from strings, etc. )
  • Scaling and (for decimal) quantizing
  • Copying and manipulating the sign (abs, negate, etc. )
  • Comparisons and total ordering
  • Classification and testing for NaNs, etc.
  • Testing and setting flags
  • Miscellaneous operations.

Exception handling

The standard defines five exceptions, each of which has a corresponding status flag that (except in certain cases of underflow) is raised when the exception occurs. No other action is required, but alternatives are recommended (see below).

The five possible exceptions are:

  • Invalid operation ( e.g. , square root of a negative number)
  • Division by zero
  • Overflow (a result is too large to be represented correctly)
  • Underflow (a result is very small (outside the normal range) and is inexact)
  • Inexact.

These are the same five exceptions as were defined in IEEE 754-1985.

Recommendations

Alternate exception handlin

GPIB (IEEE 488) - National Instruments

Rely on NI, the GPIB leader for more than 30 years. NI GPIB hardware and software offer improved performance, high reliability, and increased productivity.

...

IEEE Standards Description: 488.2-1992

488.2-1992 description. IEEE Std 488.2-1992 IEEE Standard Codes, Formats, Protocols, and Common Commands for Use With IEEE Std 488.1-1987, IEEE Standard Digital Interface for ...

...

IEEE-488 Bulkhead Adapter, Male / Female - CIB24BA

Feed any IEEE-488/GPIB cable through a panel or enclosure; Metal mounting flange accommodates grounding requirements; Cast aluminum housing provides strength, durability and crush ...

...

IEEE 488.2 Standard PCI Interface Card - PCI-488

Used to add an IEEE 488.2 PCI interface to a PC; Data transfer rates over 1 MBPS; 1024-word FIFO buffer; Complete Talker/Listener/Controller; Includes GPIB-488 software library for ...

...

IEEE-488 - Wikipedia, the free encyclopedia

IEEE-488 is a short-range, digital communications bus specification that has been in use for over 30 years. Originally created for use with automated test equipment, the standard ...

...

GPIB / IEEE488 Bus Description, HPIB Electrical Interface and IEEE-488 ...

GPIB, HPIB Bus description, GPI Bus information, timing and General Purpose Interface Bus pin outs, IEEE488 Pinout

...

IEEE 488 definition of IEEE 488 in the Free Online Encyclopedia.

IEEE 488. See GPIB. (hardware, standard) IEEE 488 - (GPIB, General-Purpose Interface Bus, HP-IB, Hewlett-Packard Interface Bus) An 8-bit parallel bus common on test equipment.

...

UPGRADED STANDARD BOOSTS SPEED OF IEEE 488 INSTRUMENT BUSES EIGHTFOLD

UPGRADED STANDARD BOOSTS SPEED OF IEEE 488 INSTRUMENT BUSES EIGHTFOLD. Contact: Karen McCabe, IEEE Senior Marketing Manager +1 732 562 3824, k.mccabe@ieee.org

...

IEEE-488 definition of IEEE-488 in the Free Online Encyclopedia.

Hewlett-Packard Interface Bus - IEEE 488

...

IEEE 488 from FOLDOC

IEEE 488 < hardware, standard > (GPIB, General-Purpose Interface Bus, HP-IB, Hewlett-Packard Interface Bus) An 8-bit parallel bus common on test equipment.

...