# <!-- var kmNextPage = "armcc_cjahgiid.htm"; var kmPrevPage = "armcc_cihgaeci.htm"; var kmNextPageTitle = "Compiler support for floating-point computations a"; var kmPrevPageTitle = "Compiler and library support for half-precision fl"; var kmBreadCrumbs = "<a href=\"default.htm\">Home</a> &raquo; <a href=\"armcc_cjafjcfg.htm\">Compiler Coding Practices</a> &raquo; Half-precision floating-point number format"; kmSetupPaging (); kmNavButtons(); //--> Half-precision floating-point number format

## Half-precision floating-point number format

The half-precision floating-point formats available are `ieee` and `alternative`. In both formats, the basic layout of the 16-bit number is the same. See Figure 1.

Where:

```   S (bit[15]):      Sign bit
E (bits[14:10]):  Biased exponent
T (bits[9:0]):    Mantissa.
```

The meanings of these fields depend on the format that is selected.

IEEE half-precision format is as follows:

```IF E==31:
IF T==0: Value = Signed infinity
IF T!=0: Value = Nan
T[9] determines Quiet or Signalling:
0: Quiet NaN
1: Signalling NaN
IF 0<E<31:
Value = (-1)Sx2(E-15)x(1+2-10T)

IF E==0:
IF T==0: Value = Signed zero
IF T!=0: Value = (-1)Sx2(-14)x(0+2-10T)
```

Alternative half-precision format is as follows:

```IF 0<E<32:
Value = (-1)Sx2(E-15)x(1+2-10T)

IF E==0:
IF T==0: Value = Signed zero
IF T!=0: Value = (-1)Sx2(-14)x(0+2-10T)
```