Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

decimal64 floating-point format

From Wikipedia, the free encyclopedia
64-bit computer number format

Floating-pointformats
IEEE 754
Other
Alternatives
Tapered floating point

Incomputing,decimal64 is adecimal floating-pointcomputer number format that occupies 8 bytes (64 bits) in computer memory. The format was formally introduced in the2008 revision[1] of theIEEE 754 standard, also known asISO/IEC/IEEE 60559:2011.[2]

Format

[edit]

Decimal64 values are categorized as normal orsubnormal (denormal) numbers and can be encoded in eitherbinary integer decimal (BID) ordensely packed decimal (DPD) formats. Normal values can possess 16-digit precision ranging from ±1.000000000000000×10−383 to ±9.999999999999999×10384. In addition to normal and subnormal numbers, the format also includes signed zeros, infinities, andNaNs.

The binary format of identical size accommodates a spectrum from denormal-min ±5×10−324, through normal-min with complete 53-bit precision ±2.2250738585072014×10−308, to maximum ±1.7976931348623157×10+308.

Because thesignificand for theIEEE 754, decimal formats are not normalized and most values with less than 16significant digits have multiple possible representations; 1000000 × 10−2 = 100000 × 10−1 = 10000 × 100 = 1000 × 101 all have the value 10000. These sets of representations for the same value are calledcohorts. The different members can be used to denote how many digits of the value are known precisely. Each signed zero has 768 possible representations (1536 for all zeros, in two different cohorts).

Encoding of decimal64 values

[edit]
SignCombinationSignificand continuation
1 bit13 bits50 bits

IEEE 754 allows two alternative encodings for decimal64 values. The standard does not specify how to signify which representation is used. For instance, in a situation where decimal64 values are communicated between systems:

  • In thebinary encoding, the 16-digit significand is represented as a binary coded positive integer, based onbinary integer decimal (BID).
  • In thedecimal encoding, the 16-digit significand is represented as a decimal coded positive integer, based ondensely packed decimal (DPD) with 5 groups of 3 digits each represented indeclets, 10-bit sequences. The most significant bit is encoded separately. This is efficient because 210 = 1024, is only slightly more than needed to contain all integers from 0 to 999.

Both alternatives provide exactly the same set of representable numbers: 16 digits of significand and3 × 28 = 768 possible decimal exponent values. All the possible decimal exponent values storable in abinary64 number are representable in decimal64, and most bits of the significand of a binary64 are stored keeping roughly the same number of decimal digits in the significand.

In both cases, the most significant 4 bits of the significand, which only have 10 possible values, are combined with two bits of the exponent (3 possible values) to use 30 of the 32 possible values of a 5-bit field. The remaining combinations encodeinfinities andNaNs. BID and DPD use different bits of the combination field.

For Infinity and NaN, all other bits of the encoding are not used. Thus, an array can be filled with a single byte value to set it to Infinities or NaNs.

Binary integer significand field

[edit]

This format uses a binary significand from 0 to1016 − 1 =9999999999999999 = 2386F26FC0FFFF16 =1000111000011011110010011011111100000011111111111111112.The encoding, completely stored on 64 bits, can represent binary significands up to10 × 250 − 1 =11258999068426239 = 27FFFFFFFFFFFF16, but values larger than1016 − 1 are illegal and the standard requires implementations to treat them as 0 if encountered on input.

As described above, the encoding varies depending on whether the most significant4 bits of the significand are in the range 0 to 7 (00002 to 01112), or higher (10002 or 10012).

If the two bits after the sign bit are "00", "01", or "10", then the exponent field consists of the10 bits following the sign bit and the significand is the remaining53 bits with an implicit leading0 bit. This includessubnormal numbers where the leading significand digit is 0.

If the2 bits after the sign bit are "11", then the 10-bit exponent field is shifted2 bits to the right (after both the sign bit and the "11" bits thereafter) and the represented significand is in the remaining51 bits. In this case there is an implicit (that is, not stored) leading 3-bit sequence "100" for the MSB bits of the true significand (in the remaining lower bitsttt...ttt of the significand, not all possible values are used).

BID Encoding
Combination FieldExponentSignificand / Description
g12g11g10g9g8g7g6g5g4g3g2g1g0
combination field not starting with '11', bits ab = 00, 01 or 10
abcdmmmmmmefgabcdmmmmmm(0)efgtttttttttttttttttttttttttttttttttttttttttttttttttt

Finite number with small first digit of significand (0 .. 7).

combination field starting with '11', but not 1111, bits ab = 11, bits cd = 00, 01 or 10
11cdmmmmmmefgcdmmmmmmef100gtttttttttttttttttttttttttttttttttttttttttttttttttt

Finite number with big first digit of significand (8 or 9).

combination field starting with '1111', bits abcd = 1111
11110±Infinity
111110quiet NaN
111111signaling NaN (with payload in significand)

The leading bits of the significand field donot encode the most significant decimal digit; they are simply part of a larger pure-binary number. For example, a significand of8000000000000000 is encoded as binary0111000110101111110101001001100011010000000000000000002 with the leading4 bits encoding 7; the first significand which requires a 54th bit is253 =9007199254740992. The highest valid significant is9999999999999999 whose binary encoding is(100)0111000011011110010011011111100000011111111111111112 (with the 3 most significant bits (100) not stored but implicit as shown above; and the next bit is always zero in valid encodings).

In the above cases, the value represented is

(−1)sign × 10exponent−398 × significand

If the four bits after the sign bit are "1111" then the value is an infinity or a NaN, as described above:

0 11110 xx...x    +infinity1 11110 xx...x    -infinityx 11111 0x...x    a quiet NaNx 11111 1x...x    a signalling NaN

Densely packed decimal significand field

[edit]

In this version, the significand is stored as a series of decimal digits. The leading digit is between 0 and 9 (3 or 4 binary bits) and the rest of the significand uses thedensely packed decimal (DPD) encoding.

The leading2 bits of the exponent and the leading digit (3 or4 bits) of the significand are combined into the five bits that follow the sign bit. The eight bits after that are the exponent continuation field, providing the less-significant bits of the exponent. The last50 bits are the significand continuation field, consisting of five 10-bit declets.[3] Eachdeclet encodes three decimal digits[3] using the DPD encoding.

If the initial two bits following the sign bit are "00", "01", or "10", they represent the leading bits of the exponent, whereas the subsequent three bits "cde" are regarded as the leading decimal digit (ranging from 0 to 7):

If the first two bits after the sign bit are "11", then the second 2-bits are the leading bits of the exponent, and the next bit "e" is prefixed with implicit bits "100" to form the leading decimal digit (8 or 9):

The remaining two combinations (11 110 and 11 111) of the 5-bit field after the sign bit are used to represent ±infinity and NaNs, respectively.

DPD Encoding
Combination FieldExponentSignificand / Description
g12g11g10g9g8g7g6g5g4g3g2g1g0
combination field not starting with '11', bits ab = 00, 01 or 10
abcdemmmmmmmmabmmmmmmmm(0)cde tttttttttt tttttttttt tttttttttt tttttttttt tttttttttt

Finite number with small first digit of significand (0 … 7).

combination field starting with '11', but not 1111, bits ab = 11, bits cd = 00, 01 or 10
11cdemmmmmmmmcdmmmmmmmm100e tttttttttt tttttttttt tttttttttt tttttttttt tttttttttt

Finite number with big first digit of significand (8 or 9).

combination field starting with '1111', bits abcd = 1111
11110±Infinity
111110quiet NaN
111111signaling NaN (with payload in significand)

The DPD/3BCD transcoding for the declets is given by the following table. b9...b0 are the bits of the DPD, and d2...d0 are the three BCD digits.

Densely packed decimal encoding rules[4]
DPD encoded valueDecimal digits
Code space
(1024 states)
b9b8b7b6b5b4b3b2b1b0d2d1d0Values encodedDescriptionOccurrences
(1000 states)
50.0%
(512 states)
abcdef0ghi0abc0def0ghi(0–7) (0–7) (0–7)3 small digits51.2%
(512 states)
37.5%
(384 states)
abcdef100i0abc0def100i(0–7) (0–7) (8–9)2 small digits,
1 large digit
38.4%
(384 states)
abcghf101i0abc100f0ghi(0–7) (8–9) (0–7)
ghcdef110i100c0def0ghi(8–9) (0–7) (0–7)
9.375%
(96 states)
ghc00f111i100c100f0ghi(8–9) (8–9) (0–7)1 small digit,
2 large digits
9.6%
(96 states)
dec01f111i100c0def100i(8–9) (0–7) (8–9)
abc10f111i0abc100f100i(0–7) (8–9) (8–9)
3.125%
(32 states, 8 used)
xxc11f111i100c100f100i(8–9) (8–9) (8–9)3 large digits,
b9, b8: don't care
0.8%
(8 states)
Representation of every number from 0 to 999
RepresentationBitsValue
000000000000
100000000011
200000000102
300000000113
400000001004
500000001015
600000001106
700000001117
800000010008
900000010019
16000001000010
17000001000111
18000001001012
19000001001113
20000001010014
21000001010115
22000001011016
23000001011117
24000001100018
25000001100119
32000010000020
33000010000121
34000010001022
35000010001123
36000010010024
37000010010125
38000010011026
39000010011127
40000010100028
41000010100129
48000011000030
49000011000131
50000011001032
51000011001133
52000011010034
53000011010135
54000011011036
55000011011137
56000011100038
57000011100139
64000100000040
65000100000141
66000100001042
67000100001143
68000100010044
69000100010145
70000100011046
71000100011147
72000100100048
73000100100149
80000101000050
81000101000151
82000101001052
83000101001153
84000101010054
85000101010155
86000101011056
87000101011157
88000101100058
89000101100159
96000110000060
97000110000161
98000110001062
99000110001163
100000110010064
101000110010165
102000110011066
103000110011167
104000110100068
105000110100169
112000111000070
113000111000171
114000111001072
115000111001173
116000111010074
117000111010175
118000111011076
119000111011177
120000111100078
121000111100179
10000000101080
11000000101181
42000010101082
43000010101183
74000100101084
75000100101185
106000110101086
107000110101187
46000010111088
47000010111189
26000001101090
27000001101191
58000011101092
59000011101193
90000101101094
91000101101195
122000111101096
123000111101197
62000011111098
63000011111199
1280010000000100
1290010000001101
1300010000010102
1310010000011103
1320010000100104
1330010000101105
1340010000110106
1350010000111107
1360010001000108
1370010001001109
1440010010000110
1450010010001111
1460010010010112
1470010010011113
1480010010100114
1490010010101115
1500010010110116
1510010010111117
1520010011000118
1530010011001119
1600010100000120
1610010100001121
1620010100010122
1630010100011123
1640010100100124
1650010100101125
1660010100110126
1670010100111127
1680010101000128
1690010101001129
1760010110000130
1770010110001131
1780010110010132
1790010110011133
1800010110100134
1810010110101135
1820010110110136
1830010110111137
1840010111000138
1850010111001139
1920011000000140
1930011000001141
1940011000010142
1950011000011143
1960011000100144
1970011000101145
1980011000110146
1990011000111147
2000011001000148
2010011001001149
2080011010000150
2090011010001151
2100011010010152
2110011010011153
2120011010100154
2130011010101155
2140011010110156
2150011010111157
2160011011000158
2170011011001159
2240011100000160
2250011100001161
2260011100010162
2270011100011163
2280011100100164
2290011100101165
2300011100110166
2310011100111167
2320011101000168
2330011101001169
2400011110000170
2410011110001171
2420011110010172
2430011110011173
2440011110100174
2450011110101175
2460011110110176
2470011110111177
2480011111000178
2490011111001179
1380010001010180
1390010001011181
1700010101010182
1710010101011183
2020011001010184
2030011001011185
2340011101010186
2350011101011187
1740010101110188
1750010101111189
1540010011010190
1550010011011191
1860010111010192
1870010111011193
2180011011010194
2190011011011195
2500011111010196
2510011111011197
1900010111110198
1910010111111199
2560100000000200
2570100000001201
2580100000010202
2590100000011203
2600100000100204
2610100000101205
2620100000110206
2630100000111207
2640100001000208
2650100001001209
2720100010000210
2730100010001211
2740100010010212
2750100010011213
2760100010100214
2770100010101215
2780100010110216
2790100010111217
2800100011000218
2810100011001219
2880100100000220
2890100100001221
2900100100010222
2910100100011223
2920100100100224
2930100100101225
2940100100110226
2950100100111227
2960100101000228
2970100101001229
3040100110000230
3050100110001231
3060100110010232
3070100110011233
3080100110100234
3090100110101235
3100100110110236
3110100110111237
3120100111000238
3130100111001239
3200101000000240
3210101000001241
3220101000010242
3230101000011243
3240101000100244
3250101000101245
3260101000110246
3270101000111247
3280101001000248
3290101001001249
3360101010000250
3370101010001251
3380101010010252
3390101010011253
3400101010100254
3410101010101255
3420101010110256
3430101010111257
3440101011000258
3450101011001259
3520101100000260
3530101100001261
3540101100010262
3550101100011263
3560101100100264
3570101100101265
3580101100110266
3590101100111267
3600101101000268
3610101101001269
3680101110000270
3690101110001271
3700101110010272
3710101110011273
3720101110100274
3730101110101275
3740101110110276
3750101110111277
3760101111000278
3770101111001279
2660100001010280
2670100001011281
2980100101010282
2990100101011283
3300101001010284
3310101001011285
3620101101010286
3630101101011287
3020100101110288
3030100101111289
2820100011010290
2830100011011291
3140100111010292
3150100111011293
3460101011010294
3470101011011295
3780101111010296
3790101111011297
3180100111110298
3190100111111299
3840110000000300
3850110000001301
3860110000010302
3870110000011303
3880110000100304
3890110000101305
3900110000110306
3910110000111307
3920110001000308
3930110001001309
4000110010000310
4010110010001311
4020110010010312
4030110010011313
4040110010100314
4050110010101315
4060110010110316
4070110010111317
4080110011000318
4090110011001319
4160110100000320
4170110100001321
4180110100010322
4190110100011323
4200110100100324
4210110100101325
4220110100110326
4230110100111327
4240110101000328
4250110101001329
4320110110000330
4330110110001331
4340110110010332
4350110110011333
4360110110100334
4370110110101335
4380110110110336
4390110110111337
4400110111000338
4410110111001339
4480111000000340
4490111000001341
4500111000010342
4510111000011343
4520111000100344
4530111000101345
4540111000110346
4550111000111347
4560111001000348
4570111001001349
4640111010000350
4650111010001351
4660111010010352
4670111010011353
4680111010100354
4690111010101355
4700111010110356
4710111010111357
4720111011000358
4730111011001359
4800111100000360
4810111100001361
4820111100010362
4830111100011363
4840111100100364
4850111100101365
4860111100110366
4870111100111367
4880111101000368
4890111101001369
4960111110000370
4970111110001371
4980111110010372
4990111110011373
5000111110100374
5010111110101375
5020111110110376
5030111110111377
5040111111000378
5050111111001379
3940110001010380
3950110001011381
4260110101010382
4270110101011383
4580111001010384
4590111001011385
4900111101010386
4910111101011387
4300110101110388
4310110101111389
4100110011010390
4110110011011391
4420110111010392
4430110111011393
4740111011010394
4750111011011395
5060111111010396
5070111111011397
4460110111110398
4470110111111399
5121000000000400
5131000000001401
5141000000010402
5151000000011403
5161000000100404
5171000000101405
5181000000110406
5191000000111407
5201000001000408
5211000001001409
5281000010000410
5291000010001411
5301000010010412
5311000010011413
5321000010100414
5331000010101415
5341000010110416
5351000010111417
5361000011000418
5371000011001419
5441000100000420
5451000100001421
5461000100010422
5471000100011423
5481000100100424
5491000100101425
5501000100110426
5511000100111427
5521000101000428
5531000101001429
5601000110000430
5611000110001431
5621000110010432
5631000110011433
5641000110100434
5651000110101435
5661000110110436
5671000110111437
5681000111000438
5691000111001439
5761001000000440
5771001000001441
5781001000010442
5791001000011443
5801001000100444
5811001000101445
5821001000110446
5831001000111447
5841001001000448
5851001001001449
5921001010000450
5931001010001451
5941001010010452
5951001010011453
5961001010100454
5971001010101455
5981001010110456
5991001010111457
6001001011000458
6011001011001459
6081001100000460
6091001100001461
6101001100010462
6111001100011463
6121001100100464
6131001100101465
6141001100110466
6151001100111467
6161001101000468
6171001101001469
6241001110000470
6251001110001471
6261001110010472
6271001110011473
6281001110100474
6291001110101475
6301001110110476
6311001110111477
6321001111000478
6331001111001479
5221000001010480
5231000001011481
5541000101010482
5551000101011483
5861001001010484
5871001001011485
6181001101010486
6191001101011487
5581000101110488
5591000101111489
5381000011010490
5391000011011491
5701000111010492
5711000111011493
6021001011010494
6031001011011495
6341001111010496
6351001111011497
5741000111110498
5751000111111499
6401010000000500
6411010000001501
6421010000010502
6431010000011503
6441010000100504
6451010000101505
6461010000110506
6471010000111507
6481010001000508
6491010001001509
6561010010000510
6571010010001511
6581010010010512
6591010010011513
6601010010100514
6611010010101515
6621010010110516
6631010010111517
6641010011000518
6651010011001519
6721010100000520
6731010100001521
6741010100010522
6751010100011523
6761010100100524
6771010100101525
6781010100110526
6791010100111527
6801010101000528
6811010101001529
6881010110000530
6891010110001531
6901010110010532
6911010110011533
6921010110100534
6931010110101535
6941010110110536
6951010110111537
6961010111000538
6971010111001539
7041011000000540
7051011000001541
7061011000010542
7071011000011543
7081011000100544
7091011000101545
7101011000110546
7111011000111547
7121011001000548
7131011001001549
7201011010000550
7211011010001551
7221011010010552
7231011010011553
7241011010100554
7251011010101555
7261011010110556
7271011010111557
7281011011000558
7291011011001559
7361011100000560
7371011100001561
7381011100010562
7391011100011563
7401011100100564
7411011100101565
7421011100110566
7431011100111567
7441011101000568
7451011101001569
7521011110000570
7531011110001571
7541011110010572
7551011110011573
7561011110100574
7571011110101575
7581011110110576
7591011110111577
7601011111000578
7611011111001579
6501010001010580
6511010001011581
6821010101010582
6831010101011583
7141011001010584
7151011001011585
7461011101010586
7471011101011587
6861010101110588
6871010101111589
6661010011010590
6671010011011591
6981010111010592
6991010111011593
7301011011010594
7311011011011595
7621011111010596
7631011111011597
7021010111110598
7031010111111599
7681100000000600
7691100000001601
7701100000010602
7711100000011603
7721100000100604
7731100000101605
7741100000110606
7751100000111607
7761100001000608
7771100001001609
7841100010000610
7851100010001611
7861100010010612
7871100010011613
7881100010100614
7891100010101615
7901100010110616
7911100010111617
7921100011000618
7931100011001619
8001100100000620
8011100100001621
8021100100010622
8031100100011623
8041100100100624
8051100100101625
8061100100110626
8071100100111627
8081100101000628
8091100101001629
8161100110000630
8171100110001631
8181100110010632
8191100110011633
8201100110100634
8211100110101635
8221100110110636
8231100110111637
8241100111000638
8251100111001639
8321101000000640
8331101000001641
8341101000010642
8351101000011643
8361101000100644
8371101000101645
8381101000110646
8391101000111647
8401101001000648
8411101001001649
8481101010000650
8491101010001651
8501101010010652
8511101010011653
8521101010100654
8531101010101655
8541101010110656
8551101010111657
8561101011000658
8571101011001659
8641101100000660
8651101100001661
8661101100010662
8671101100011663
8681101100100664
8691101100101665
8701101100110666
8711101100111667
8721101101000668
8731101101001669
8801101110000670
8811101110001671
8821101110010672
8831101110011673
8841101110100674
8851101110101675
8861101110110676
8871101110111677
8881101111000678
8891101111001679
7781100001010680
7791100001011681
8101100101010682
8111100101011683
8421101001010684
8431101001011685
8741101101010686
8751101101011687
8141100101110688
8151100101111689
7941100011010690
7951100011011691
8261100111010692
8271100111011693
8581101011010694
8591101011011695
8901101111010696
8911101111011697
8301100111110698
8311100111111699
8961110000000700
8971110000001701
8981110000010702
8991110000011703
9001110000100704
9011110000101705
9021110000110706
9031110000111707
9041110001000708
9051110001001709
9121110010000710
9131110010001711
9141110010010712
9151110010011713
9161110010100714
9171110010101715
9181110010110716
9191110010111717
9201110011000718
9211110011001719
9281110100000720
9291110100001721
9301110100010722
9311110100011723
9321110100100724
9331110100101725
9341110100110726
9351110100111727
9361110101000728
9371110101001729
9441110110000730
9451110110001731
9461110110010732
9471110110011733
9481110110100734
9491110110101735
9501110110110736
9511110110111737
9521110111000738
9531110111001739
9601111000000740
9611111000001741
9621111000010742
9631111000011743
9641111000100744
9651111000101745
9661111000110746
9671111000111747
9681111001000748
9691111001001749
9761111010000750
9771111010001751
9781111010010752
9791111010011753
9801111010100754
9811111010101755
9821111010110756
9831111010111757
9841111011000758
9851111011001759
9921111100000760
9931111100001761
9941111100010762
9951111100011763
9961111100100764
9971111100101765
9981111100110766
9991111100111767
10001111101000768
10011111101001769
10081111110000770
10091111110001771
10101111110010772
10111111110011773
10121111110100774
10131111110101775
10141111110110776
10151111110111777
10161111111000778
10171111111001779
9061110001010780
9071110001011781
9381110101010782
9391110101011783
9701111001010784
9711111001011785
10021111101010786
10031111101011787
9421110101110788
9431110101111789
9221110011010790
9231110011011791
9541110111010792
9551110111011793
9861111011010794
9871111011011795
10181111111010796
10191111111011797
9581110111110798
9591110111111799
120000001100800
130000001101801
2680100001100802
2690100001101803
5241000001100804
5251000001101805
7801100001100806
7811100001101807
780001001110808
790001001111809
280000011100810
290000011101811
2840100011100812
2850100011101813
5401000011100814
5411000011101815
7961100011100816
7971100011101817
940001011110818
950001011111819
440000101100820
450000101101821
3000100101100822
3010100101101823
5561000101100824
5571000101101825
8121100101100826
8131100101101827
3340101001110828
3350101001111829
600000111100830
610000111101831
3160100111100832
3170100111101833
5721000111100834
5731000111101835
8281100111100836
8291100111101837
3500101011110838
3510101011111839
760001001100840
770001001101841
3320101001100842
3330101001101843
5881001001100844
5891001001101845
8441101001100846
8451101001101847
5901001001110848
5911001001111849
920001011100850
930001011101851
3480101011100852
3490101011101853
6041001011100854
6051001011101855
8601101011100856
8611101011101857
6061001011110858
6071001011111859
1080001101100860
1090001101101861
3640101101100862
3650101101101863
6201001101100864
6211001101101865
8761101101100866
8771101101101867
8461101001110868
8471101001111869
1240001111100870
1250001111101871
3800101111100872
3810101111101873
6361001111100874
6371001111101875
8921101111100876
8931101111101877
8621101011110878
8631101011111879
140000001110880
150000001111881
2700100001110882
2710100001111883
5261000001110884
5271000001111885
7821100001110886
7831100001111887
1100001101110888
1110001101111889
300000011110890
310000011111891
2860100011110892
2870100011111893
5421000011110894
5431000011111895
7981100011110896
7991100011111897
1260001111110898
1270001111111899
1400010001100900
1410010001101901
3960110001100902
3970110001101903
6521010001100904
6531010001101905
9081110001100906
9091110001101907
2060011001110908
2070011001111909
1560010011100910
1570010011101911
4120110011100912
4130110011101913
6681010011100914
6691010011101915
9241110011100916
9251110011101917
2220011011110918
2230011011111919
1720010101100920
1730010101101921
4280110101100922
4290110101101923
6841010101100924
6851010101101925
9401110101100926
9411110101101927
4620111001110928
4630111001111929
1880010111100930
1890010111101931
4440110111100932
4450110111101933
7001010111100934
7011010111101935
9561110111100936
9571110111101937
4780111011110938
4790111011111939
2040011001100940
2050011001101941
4600111001100942
4610111001101943
7161011001100944
7171011001101945
9721111001100946
9731111001101947
7181011001110948
7191011001111949
2200011011100950
2210011011101951
4760111011100952
4770111011101953
7321011011100954
7331011011101955
9881111011100956
9891111011101957
7341011011110958
7351011011111959
2360011101100960
2370011101101961
4920111101100962
4930111101101963
7481011101100964
7491011101101965
10041111101100966
10051111101101967
9741111001110968
9751111001111969
2520011111100970
2530011111101971
5080111111100972
5090111111101973
7641011111100974
7651011111101975
10201111111100976
10211111111101977
9901111011110978
9911111011111979
1420010001110980
1430010001111981
3980110001110982
3990110001111983
6541010001110984
6551010001111985
9101110001110986
9111110001111987
2380011101110988
2390011101111989
1580010011110990
1590010011111991
4140110011110992
4150110011111993
6701010011110994
6711010011111995
9261110011110996
9271110011111997
2540011111110998
2550011111111999


The 8 decimal values whose digits are all 8s or 9s have four codings each. The bits marked x in the table above areignored on input, but will always be 0 in computed results. The8 × 3 = 24 non-standard encodings fill in the gap between103 = 1000 and 210 = 1024.

In the above cases, with thetrue significand as the sequence of decimal digits decoded, the value represented is

(1)signbit×10exponentbits239810×truesignificand10{\displaystyle (-1)^{\text{signbit}}\times 10^{{\text{exponentbits}}_{2}-398_{10}}\times {\text{truesignificand}}_{10}}

Implementations

[edit]
icon
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(November 2025) (Learn how and when to remove this message)

There are multiple libraries available for calculations with decimal data types. Some examples are listed below:

  • Libdfp implements the ISO/IEC Technical Report "ISO/IEC TR 24732". The library implements math functions for environments built ongcc andglibc. It uses BID-encoded IEEE 754 decimal types, with the possibility to switch to Decimal64 floating-point format via recompilation ofgcc. The library can be slow, and sometimes inaccurate, for conversions and complicated operations.
  • Intel Decimal Floating-Point Math Library is aC library that implements the IEEE 754-2008 Decimal Floating-Point Arithmetic specification by addressing decimal types asUINTxx items nameddecimalxx. The library improves performance by calculating more intricate functions in binary where possible, but this introduces some binary rounding errors into decimal calculations.
  • decNumber provides data types and functions to calculate values using Decimal Floating-Point with arbitrary precision. It features the option to set the IEEE 754-compatible parametersdecSingle,decDouble, anddecQuad. It efficiently performs conversions between decimal numbers and strings.
  • Mpdecimal is an implementation of theGeneral Decimal Arithmetic Specification proposed byMike Cowlishaw, with the option to set IEEE type-compatible parameters. It providesarbitrary precision, using an 8-bit integer to encode runtime flags and the number’s sign. The library represents numbers using seven or more double- or quad-words, storing the signed exponent, the digits, the length in words, the allocated words, a pointer todata, anddata itself.Data is stored as an array of two or more words, which holds the coefficient in 32-bit (9-digit) or 64-bit (19-digit) items. The library can handle a wide range of inputs and produces accurate results. It is implemented inPython as thedecimal module.

See also

[edit]

References

[edit]
  1. ^IEEE Computer Society (2008-08-29).IEEE Standard for Floating-Point Arithmetic.IEEE.doi:10.1109/IEEESTD.2008.4610935.ISBN 978-0-7381-5753-5. IEEE Std 754-2008.
  2. ^ISO/IEC JTC 1/SC 25 (June 2011).ISO/IEC/IEEE 60559:2011 – Information technology – Microprocessor Systems – Floating-Point arithmetic. ISO. pp. 1–58.{{cite book}}: CS1 maint: numeric names: authors list (link)
  3. ^abMuller, Jean-Michel; Brisebarre, Nicolas; de Dinechin, Florent; Jeannerod, Claude-Pierre; Lefèvre, Vincent; Melquiond, Guillaume;Revol, Nathalie; Stehlé, Damien; Torres, Serge (2010).Handbook of Floating-Point Arithmetic (1 ed.).Birkhäuser.doi:10.1007/978-0-8176-4705-6.ISBN 978-0-8176-4704-9.LCCN 2009939668.
  4. ^Cowlishaw, Michael Frederic (2007-02-13) [2000-10-03]."A Summary of Densely Packed Decimal encoding".IBM.Archived from the original on 2015-09-24. Retrieved2016-02-07.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Decimal64_floating-point_format&oldid=1331743168"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp