Java Reference
In-Depth Information
cordingtotherangeandtheprecisionrequired.Forexample,thecomputersof
theCDC6000,7000,andCYBERseriesuseda96-digitsignificandwithan
11-digitexponent,whilethePDP11seriesused55-digitsignificandsand8-digit
exponents.
Historicalvariations,incompatibilities,andinconsistenciesinfloat-
ing-pointformatscreatedaneedtostandardize.InMarchandJuly1985,the
ComputerSocietyoftheInstituteofElectricandElectronicEngineers(IEEE)
andtheAmericanNationalStandardsInstitute(ANSI)approvedastandard
forbinaryfloating-pointarithmetic(ANSI/IEEEStandard754-1985).Thisstan-
dardestablishedfourformatsforencodingbinaryfloating-pointnumbers. Ta-
ble20-2 summarizesthecharacteristicsoftheseformats.
Table20-2
ANSI/IEEEFloatingPointFormats
SINGLE
DOUBLE
PARAMETER
SINGLE
EXTENDEDDOUBLEEXTENDED
totalbits
32
43
64
79
significandbits
24
32
53
64
maximumexponent+127
+1023
+1023
+16383
minimumexponent-126
+1022
-1022
+16382
exponentwidth
8
11
11
15
exponentbias
+127
---
+1023
---
Binary-CodedDecimals(BCD)
Binaryfloating-pointencodingsareusuallyconsideredthemostefficientfor-
matforstoringnumericaldatainadigitalcomputer.Otherrepresentationsare
alsousedincomputerwork. Binary-codeddecimal (BCD)isarepresentation
ofdecimaldigitsinbinaryform.TherearetwocommonwaysofstoringBCD
digits.Oneisknownasthe packed BCDformatandtheotheroneas unpacked .
Intheunpackedformat,oneBCDdigitisrepresentedinonebyteofmemory
storage.InpackedformtwoBCDdigitsareencodedperbyteofstorage.Theun-
packedBCDformatdoesnotusethefourhigh-orderbitsofeachbyte,whichis
wastedstoragespace.Ontheotherhand,theunpackedformatfacilitatescon-
versionsandarithmeticoperationsonsomemachines. Figure20-4 ( onthefol-
lowing page) shows the memory storage of a packed and unpacked BCD
number.
Floating-point BCD
Binary-coded decimal representations and BCD arithmetic have not been ex-
plicitlydescribedinaformalstandard.Eachmachine,programminglanguage,
orapplication,storesandmanipulatesBCDnumbersinuniqueandoftenin-
compatible ways.
 
Search WWH ::




Custom Search