/
Lecture 04 Floating Point.ass
1561 lines (1558 loc) · 150 KB
/
Lecture 04 Floating Point.ass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: TV.601
PlayResX: 1280
PlayResY: 720
[Aegisub Project Garbage]
Last Style Storage: Default
Audio File: ../../../../Desktop/Lecture 04.mp4
Video File: ../../../../Desktop/Lecture 04.mp4
Video AR Mode: 4
Video AR Value: 1.777778
Video Zoom Percent: 1.000000
Scroll Position: 1515
Active Line: 1531
Video Position: 128387
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: English,Noto Sans CJK SC Black,30,&H00FFFFFF,&H00412A2C,&H00412A2C,&H00412A2C,0,0,0,0,100,100,0,0,1,1.5,1.2,2,10,10,10,1
Style: Chinese,Noto Sans CJK SC Black,40,&H00FFFF00,&H00FFFFFF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,1.2,1.2,2,10,10,10,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.86,0:00:02.36,English,,0,0,0,,Good afternoon everybody
Dialogue: 0,0:00:00.86,0:00:02.36,Chinese,,0,0,0,,大家下午好
Dialogue: 0,0:00:03.42,0:00:04.36,English,,0,0,0,,Welcome
Dialogue: 0,0:00:03.42,0:00:04.36,Chinese,,0,0,0,,欢迎
Dialogue: 0,0:00:05.64,0:00:06.70,English,,0,0,0,,Good to see you
Dialogue: 0,0:00:05.64,0:00:06.70,Chinese,,0,0,0,,很高兴见到你们
Dialogue: 0,0:00:11.32,0:00:17.46,English,,0,0,0,,So today we're going to study an arcane area of computer systems known as floating point
Dialogue: 0,0:00:11.32,0:00:17.46,Chinese,,0,0,0,,今天要学习的是浮点数,它是计算机系统中比较难理解的内容
Dialogue: 0,0:00:17.98,0:00:22.34,English,,0,0,0,,Which is the way that computer systems represent the real numbers
Dialogue: 0,0:00:17.98,0:00:22.34,Chinese,,0,0,0,,它是计算机系统内部表示实数的方法
Dialogue: 0,0:00:24.54,0:00:31.06,English,,0,0,0,,So you're all familiar with decimal you know something like 3.14
Dialogue: 0,0:00:24.54,0:00:31.06,Chinese,,0,0,0,,你们都熟悉十进制,比方说 3.14
Dialogue: 0,0:00:31.52,0:00:36.36,English,,0,0,0,,And there's a similar idea with binary numbers
Dialogue: 0,0:00:31.52,0:00:36.36,Chinese,,0,0,0,,二进制数也有类似的东西
Dialogue: 0,0:00:36.82,0:00:50.04,English,,0,0,0,,Okay so what does a fractional binary number like 10111.01 represent and how does that work
Dialogue: 0,0:00:36.82,0:00:50.04,Chinese,,0,0,0,,那么像 10111.01 那样的二进制小数代表什么呢?它是如何使用的?
Dialogue: 0,0:00:51.96,0:00:58.34,English,,0,0,0,, Well, it works just like the fractional decimal numbers that you used to
Dialogue: 0,0:00:51.96,0:00:58.34,Chinese,,0,0,0,,它就像你熟悉的十进制小数一样使用
Dialogue: 0,0:01:04.92,0:01:08.76,English,,0,0,0,,So you have a... this case, it's a binary point
Dialogue: 0,0:01:04.92,0:01:08.76,Chinese,,0,0,0,,在二进制小数中有一个二进制小数点
Dialogue: 0,0:01:08.76,0:01:10.62,English,,0,0,0,,And to the left of the binary point
Dialogue: 0,0:01:08.76,0:01:10.62,Chinese,,0,0,0,,在二进制小数点的左边
Dialogue: 0,0:01:12.50,0:01:16.46,English,,0,0,0,,You have bit positions to representing powers-of-2
Dialogue: 0,0:01:12.50,0:01:16.46,Chinese,,0,0,0,,每一位代表 2 的正幂
Dialogue: 0,0:01:16.46,0:01:20.00,English,,0,0,0,,So 2^0, 2^1, 2^2
Dialogue: 0,0:01:16.46,0:01:20.00,Chinese,,0,0,0,,所以左边的每一位分别代表 2^0,2^1,2^2
Dialogue: 0,0:01:20.64,0:01:26.60,English,,0,0,0,,So 1/2... I'm sorry. 1, 2, 4 and so on
Dialogue: 0,0:01:20.64,0:01:26.60,Chinese,,0,0,0,,所以从小数点开始向左依次是 1,2,4 等等
Dialogue: 0,0:01:27.34,0:01:30.50,English,,0,0,0,,And to the right of the binary point
Dialogue: 0,0:01:27.34,0:01:30.50,Chinese,,0,0,0,,在二进制小数点的右侧
Dialogue: 0,0:01:31.04,0:01:40.46,English,,0,0,0,,You have 2^-1=1/2, 2^-2=1/4, 2^-3=1/8 and so on
Dialogue: 0,0:01:31.04,0:01:40.46,Chinese,,0,0,0,,存在 2^-1=1/2,2^-2=1/4,2^-3=1/8 等等
Dialogue: 0,0:01:41.20,0:01:46.80,English,,0,0,0,,So we can represent the... any fractional binary number
Dialogue: 0,0:01:41.20,0:01:46.80,Chinese,,0,0,0,,所以我们可以使用这种标记法表示任何二进制小数
Dialogue: 0,0:01:47.54,0:01:57.36,English,,0,0,0,,Using this notation where we sum each the bit at position k*2^k
Dialogue: 0,0:01:47.54,0:01:57.36,Chinese,,0,0,0,,我们对每个第 k 处的值乘 2^k 后求和
Dialogue: 0,0:01:58.76,0:02:05.46,English,,0,0,0,,Ok so it's really works exactly the same way as with base 10, just with base 2
Dialogue: 0,0:01:58.76,0:02:05.46,Chinese,,0,0,0,,这与 10 进制完全相同,只是将基数变成了 2
Dialogue: 0,0:02:08.94,0:02:13.94,English,,0,0,0,,So let's look at some of these values
Dialogue: 0,0:02:08.94,0:02:13.94,Chinese,,0,0,0,,那么让我们看看其中一些值
Dialogue: 0,0:02:13.94,0:02:20.24,English,,0,0,0,,So 5 3/4 we would represent as 101.11
Dialogue: 0,0:02:13.94,0:02:20.24,Chinese,,0,0,0,,所以 5 3/4 会被表示为 101.11
Dialogue: 0,0:02:21.96,0:02:27.96,English,,0,0,0,,So this is before, (1*2^1) plus 1 is 5
Dialogue: 0,0:02:21.96,0:02:27.96,Chinese,,0,0,0,,所以二进制小数点左边相加后是5
Dialogue: 0,0:02:29.30,0:02:32.58,English,,0,0,0,,+1/2, +1/4
Dialogue: 0,0:02:29.30,0:02:32.58,Chinese,,0,0,0,,(右边)+1/2, +1/4
Dialogue: 0,0:02:32.88,0:02:38.40,English,,0,0,0,,Ok so 2/4+1/4=3/4. so 5 3/4
Dialogue: 0,0:02:32.88,0:02:38.40,Chinese,,0,0,0,,2/4+1/4=3/4。最终结果 5 3/4
Dialogue: 0,0:02:38.92,0:02:40.50,English,,0,0,0,,Ok so that's pretty simple
Dialogue: 0,0:02:38.92,0:02:40.50,Chinese,,0,0,0,,好的,这很简单
Dialogue: 0,0:02:41.34,0:02:51.92,English,,0,0,0,,2 7/8 is 10.111 so that 10 is 2 of course
Dialogue: 0,0:02:41.34,0:02:51.92,Chinese,,0,0,0,,2 7/8 表示为 10.111。二进制中的 10 是十进制中的 2
Dialogue: 0,0:02:53.90,0:03:08.66,English,,0,0,0,,And then .111 is 1/2,so 4/8, 1/4=2/8+1/8, okay so 7/8
Dialogue: 0,0:02:53.90,0:03:08.66,Chinese,,0,0,0,,然后 .111 是 1/2(4/8)+ 1/4(2/8)+ 1/8 = 7/8
Dialogue: 0,0:03:11.58,0:03:21.04,English,,0,0,0,,And 1 7/16 would be 1.0111
Dialogue: 0,0:03:11.58,0:03:21.04,Chinese,,0,0,0,,1 7/16 将是 1.0111
Dialogue: 0,0:03:21.16,0:03:24.20,English,,0,0,0,,So that the 1 to the left of the binary point is 1
Dialogue: 0,0:03:21.16,0:03:24.20,Chinese,,0,0,0,,这样二进制小数点左边的 1 就是 1
Dialogue: 0,0:03:25.08,0:03:31.04,English,,0,0,0,,And then we have 1/4+1/8+1/16
Dialogue: 0,0:03:25.08,0:03:31.04,Chinese,,0,0,0,,然后有 1/4+1/8+1/16
Dialogue: 0,0:03:32.00,0:03:47.70,English,,0,0,0,,So 1/4 is 4/16, 1/8 is 2/16 and 1/16,so you add those up you get 7/16
Dialogue: 0,0:03:32.00,0:03:47.70,Chinese,,0,0,0,,所以 1/4 是 4/16,1/8 是 2/16,还有 1/16,所以总和为 7/16
Dialogue: 0,0:03:49.48,0:03:51.66,English,,0,0,0,,Okay now notice that for some of these numbers
Dialogue: 0,0:03:49.48,0:03:51.66,Chinese,,0,0,0,,好的,现在注意到其中一些数字
Dialogue: 0,0:03:51.66,0:03:57.90,English,,0,0,0,,This bit pattern 101.11
Dialogue: 0,0:03:51.66,0:03:57.90,Chinese,,0,0,0,,这个位组合,101.11
Dialogue: 0,0:03:58.50,0:04:02.82,English,,0,0,0,,If we shift it to the right to get 10.111
Dialogue: 0,0:03:58.50,0:04:02.82,Chinese,,0,0,0,,如果我们将数字向右移动,获得 10.111
Dialogue: 0,0:04:04.36,0:04:08.58,English,,0,0,0,,We've divided by 2, right? So we've taken 5 3/4 and divided it by 2
Dialogue: 0,0:04:04.36,0:04:08.58,Chinese,,0,0,0,,就相当于用 5 3/4 除以2
Dialogue: 0,0:04:09.20,0:04:12.00,English,,0,0,0,,And it works the other way too
Dialogue: 0,0:04:09.20,0:04:12.00,Chinese,,0,0,0,,反方向也同样适用
Dialogue: 0,0:04:12.00,0:04:17.28,English,,0,0,0,,If you shift to the left you multiply. If you shift to the left by 1 you multiply by 1
Dialogue: 0,0:04:12.00,0:04:17.28,Chinese,,0,0,0,,如果将数字向左移动 1 位,则乘 2 一次
Dialogue: 0,0:04:19.02,0:04:26.12,English,,0,0,0,,And these numbers that are all ones to the right of the of the binary point
Dialogue: 0,0:04:19.02,0:04:26.12,Chinese,,0,0,0,,而二进制小数点右边的数字
Dialogue: 0,0:04:26.12,0:04:31.62,English,,0,0,0,,These are numbers that are just slightly less than 1
Dialogue: 0,0:04:26.12,0:04:31.62,Chinese,,0,0,0,,这些数字只比 1 小一点点
Dialogue: 0,0:04:33.50,0:04:36.14,English,,0,0,0,,So well when we want to represent those
Dialogue: 0,0:04:33.50,0:04:36.14,Chinese,,0,0,0,,因此,当我们想要表示这些值的时候
Dialogue: 0,0:04:36.14,0:04:43.36,English,,0,0,0,,We will sometimes refer to those numbers of that form is 1- ℇ
Dialogue: 0,0:04:36.14,0:04:43.36,Chinese,,0,0,0,,我们有时会以 1.0-ℇ 指代那些形式的数字
Dialogue: 0,0:04:43.36,0:04:50.16,English,,0,0,0,,And ℇ just depends on how many bits you have to the right of the binary point
Dialogue: 0,0:04:43.36,0:04:50.16,Chinese,,0,0,0,,而 ℇ 取决于你在二进制小数点右边有多少位
Dialogue: 0,0:04:50.38,0:04:56.40,English,,0,0,0,,So ℇ gets smaller the more,the more of those bits you have there, it gets closer to 1
Dialogue: 0,0:04:50.38,0:04:56.40,Chinese,,0,0,0,,因此,ℇ 变得越小,二进制数的值就越接近 1
Dialogue: 0,0:04:56.90,0:04:59.30,English,,0,0,0,,And ℇ gets smaller the more of those bits you have
Dialogue: 0,0:04:56.90,0:04:59.30,Chinese,,0,0,0,,并且 ℇ 越小,二进制小数点右边的位就越多
Dialogue: 0,0:05:00.92,0:05:08.08,English,,0,0,0,,Now there's limitations in this kind of representation
Dialogue: 0,0:05:00.92,0:05:08.08,Chinese,,0,0,0,,但是,这种表示法存在局限性
Dialogue: 0,0:05:08.08,0:05:14.18,English,,0,0,0,,So first of all we can only represent rational numbers of the form x/2^k
Dialogue: 0,0:05:08.08,0:05:14.18,Chinese,,0,0,0,,首先,我们只能表示形如 x/2^k 的有理数
Dialogue: 0,0:05:14.18,0:05:16.80,English,,0,0,0,,We can only represent numbers of that form exactly
Dialogue: 0,0:05:14.18,0:05:16.80,Chinese,,0,0,0,,可表示的数必须严格满足那种形式
Dialogue: 0,0:05:17.20,0:05:23.70,English,,0,0,0,,Other numbers have to get have repeating bit representations that can't be represented
Dialogue: 0,0:05:17.20,0:05:23.70,Chinese,,0,0,0,,不满足上述形式的数需要循环重复位才能被准确表示
Dialogue: 0,0:05:24.06,0:05:27.82,English,,0,0,0,,with a finite number of bits that we have in a computer system
Dialogue: 0,0:05:24.06,0:05:27.82,Chinese,,0,0,0,,由于现在计算机中的位数是有限的,所以需要循环重复位的数不能被准确表示
Dialogue: 0,0:05:29.14,0:05:38.54,English,,0,0,0,,So for example things like a 1/3 is this repeating representation 1/5 and 1/10 or other examples of that
Dialogue: 0,0:05:29.14,0:05:38.54,Chinese,,0,0,0,,因此,例如 1/3 就是需要循环重复位才能被准确表示的数,1/5 和 1/10 也是
Dialogue: 0,0:05:39.28,0:05:42.06,English,,0,0,0,,Now the other problem we have is that
Dialogue: 0,0:05:39.28,0:05:42.06,Chinese,,0,0,0,,现在我们遇到的另一个问题是
Dialogue: 0,0:05:42.68,0:05:45.18,English,,0,0,0,,We can only...
Dialogue: 0,0:05:42.68,0:05:45.18,Chinese,,0,0,0,,我们只能……
Dialogue: 0,0:05:45.18,0:05:49.02,English,,0,0,0,,There's only so many bits to the left and the right of the the binary point
Dialogue: 0,0:05:45.18,0:05:49.02,Chinese,,0,0,0,,二进制小数点的左侧和右侧只有那么多位
Dialogue: 0,0:05:49.88,0:05:52.06,English,,0,0,0,,So we're kind of...
Dialogue: 0,0:05:49.88,0:05:52.06,Chinese,,0,0,0,,所以
Dialogue: 0,0:05:52.12,0:05:55.48,English,,0,0,0,,If we move the binary point to the left
Dialogue: 0,0:05:52.12,0:05:55.48,Chinese,,0,0,0,,如果我们将二进制小数点左移
Dialogue: 0,0:05:56.98,0:06:02.90,English,,0,0,0,,Then we don't have as many... We can't represent as many large numbers
Dialogue: 0,0:05:56.98,0:06:02.90,Chinese,,0,0,0,,那么,很多原本能表示的数值较大的数现在就不能被表示了
Dialogue: 0,0:06:02.90,0:06:04.62,English,,0,0,0,,We can only represent small numbers
Dialogue: 0,0:06:02.90,0:06:04.62,Chinese,,0,0,0,,我们只能表示小一点的数字
Dialogue: 0,0:06:04.62,0:06:07.54,English,,0,0,0,,But we have more precision to the right of the binary point
Dialogue: 0,0:06:04.62,0:06:07.54,Chinese,,0,0,0,,但是在二进制小数部分有更高的精度
Dialogue: 0,0:06:07.76,0:06:10.18,English,,0,0,0,,So we can represent more fractional values
Dialogue: 0,0:06:07.76,0:06:10.18,Chinese,,0,0,0,,所以我们可以表示更多的小数值
Dialogue: 0,0:06:10.60,0:06:13.70,English,,0,0,0,,Just the range of those values will be much smaller
Dialogue: 0,0:06:10.60,0:06:13.70,Chinese,,0,0,0,,只是总的取值范围会小得多
Dialogue: 0,0:06:14.56,0:06:16.98,English,,0,0,0,,Similarly if we move the binary point to the right
Dialogue: 0,0:06:14.56,0:06:16.98,Chinese,,0,0,0,,同样,如果我们将二进制小数点向右移动
Dialogue: 0,0:06:17.78,0:06:20.32,English,,0,0,0,,We'll have a larger range of values
Dialogue: 0,0:06:17.78,0:06:20.32,Chinese,,0,0,0,,我们将拥有更大的取值范围
Dialogue: 0,0:06:20.54,0:06:23.18,English,,0,0,0,,But we won't build represent as many fractions
Dialogue: 0,0:06:20.54,0:06:23.18,Chinese,,0,0,0,,但我们不能表示同样多的小数
Dialogue: 0,0:06:24.82,0:06:32.06,English,,0,0,0,,So there's this kind of trade-off and floating point is a representation
Dialogue: 0,0:06:24.82,0:06:32.06,Chinese,,0,0,0,,因此,选择浮点作为折中的表示方式
Dialogue: 0,0:06:32.80,0:06:42.76,English,,0,0,0,,to try that enables us to move that basically to move that binary point to represent sort of as wide a range as possible
Dialogue: 0,0:06:32.80,0:06:42.76,Chinese,,0,0,0,,浮点主要通过移动二进制小数点来表示尽可能大的取值范围
Dialogue: 0,0:06:43.14,0:06:46.26,English,,0,0,0,,with as much precision given the number of bits
Dialogue: 0,0:06:43.14,0:06:46.26,Chinese,,0,0,0,,兼顾尽可能高的精度
Dialogue: 0,0:06:46.78,0:06:49.14,English,,0,0,0,,the finite number of bits that we have to work with
Dialogue: 0,0:06:46.78,0:06:49.14,Chinese,,0,0,0,,同时还要受到位数有限的制约
Dialogue: 0,0:06:49.50,0:06:54.56,English,,0,0,0,,So that the float and floating point is this sort of shifting binary point. Right
Dialogue: 0,0:06:49.50,0:06:54.56,Chinese,,0,0,0,,因此,浮点就是这种移动的二进制小数点
Dialogue: 0,0:06:54.56,0:06:57.16,English,,0,0,0,,This floating, the floating binary point
Dialogue: 0,0:06:54.56,0:06:57.16,Chinese,,0,0,0,,能够不断变换位置的二进制小数点
Dialogue: 0,0:06:59.24,0:07:02.24,English,,0,0,0,,Now up until 1985
Dialogue: 0,0:06:59.24,0:07:02.24,Chinese,,0,0,0,,在 1985 年之前
Dialogue: 0,0:07:02.64,0:07:05.94,English,,0,0,0,,A floating point was just a disaster
Dialogue: 0,0:07:02.64,0:07:05.94,Chinese,,0,0,0,,浮点数一直是一场灾难
Dialogue: 0,0:07:06.48,0:07:11.18,English,,0,0,0,,And every computer manufacturer had their own representation
Dialogue: 0,0:07:06.48,0:07:11.18,Chinese,,0,0,0,,每个计算机制造商都有自己的实现方式
Dialogue: 0,0:07:12.40,0:07:16.22,English,,0,0,0,,You couldn't...and it was just terrible,because you couldn't predict
Dialogue: 0,0:07:12.40,0:07:16.22,Chinese,,0,0,0,,它太可怕了,因为你无法预测会发什么
Dialogue: 0,0:07:16.90,0:07:21.46,English,,0,0,0,,What would happen if you moved your program from one machine to another
Dialogue: 0,0:07:16.90,0:07:21.46,Chinese,,0,0,0,,如果你将程序换一台机器运行
Dialogue: 0,0:07:21.84,0:07:24.66,English,,0,0,0,,The behavior would be different the rounding would be different
Dialogue: 0,0:07:21.84,0:07:24.66,Chinese,,0,0,0,,(程序的)行为会变得不同,舍入也会变得不同
Dialogue: 0,0:07:25.86,0:07:35.13,English,,0,0,0,,It was a very difficult situation and people really, computer scientists in particular, really disliked floating point
Dialogue: 0,0:07:25.86,0:07:35.13,Chinese,,0,0,0,,这是一个非常糟糕的状况,人们特别是计算机科学家真的不喜欢浮点
Dialogue: 0,0:07:35.62,0:07:45.02,English,,0,0,0,,In 1985 IEEE which is the professional association for electrical engineers
Dialogue: 0,0:07:35.62,0:07:45.02,Chinese,,0,0,0,,1985 年,电气电子工程师协会(IEEE)
Dialogue: 0,0:07:45.44,0:07:51.02,English,,0,0,0,,Introduced a...and it's also a very important standards body
Dialogue: 0,0:07:45.44,0:07:51.02,Chinese,,0,0,0,,引入了一个非常重要的标准化表示
Dialogue: 0,0:07:51.34,0:07:56.54,English,,0,0,0,,They introduced a standard floating-point representation called IEEE floating point
Dialogue: 0,0:07:51.34,0:07:56.54,Chinese,,0,0,0,,他们引入了一个称为 IEEE 浮点数的标准浮点数表示法
Dialogue: 0,0:07:57.16,0:08:00.52,English,,0,0,0,,which was then adopted by all computer manufacturers
Dialogue: 0,0:07:57.16,0:08:00.52,Chinese,,0,0,0,,得到了所有计算机制造商的一致采用
Dialogue: 0,0:08:00.52,0:08:02.16,English,,0,0,0,,So now the situation is much better
Dialogue: 0,0:08:00.52,0:08:02.16,Chinese,,0,0,0,,所以现在情况要好得多
Dialogue: 0,0:08:02.60,0:08:06.96,English,,0,0,0,,Everybody supports the same kind of floating point representation
Dialogue: 0,0:08:02.60,0:08:06.96,Chinese,,0,0,0,,各方都支持相同类型的浮点数表示
Dialogue: 0,0:08:06.98,0:08:08.84,English,,0,0,0,,which is what we're going to learn about today
Dialogue: 0,0:08:06.98,0:08:08.84,Chinese,,0,0,0,,这就是我们今天要学习的内容
Dialogue: 0,0:08:14.66,0:08:18.38,English,,0,0,0,,So the floating point has the form
Dialogue: 0,0:08:14.66,0:08:18.38,Chinese,,0,0,0,,所以浮点数有如下形式
Dialogue: 0,0:08:19.34,0:08:24.26,English,,0,0,0,,It represents numbers in a... this is, like a scientific notation
Dialogue: 0,0:08:19.34,0:08:24.26,Chinese,,0,0,0,,它以一种类似科学计数法的方式来表示数字
Dialogue: 0,0:08:24.46,0:08:36.66,English,,0,0,0,,It represents numbers of the form (-1)^S*M*2^E,where S is a sign bit,times a significand M
Dialogue: 0,0:08:24.46,0:08:36.66,Chinese,,0,0,0,,它表示形式 (-1)^S*M*2^E 的数字,其中 S 是符号位,乘以尾数 M
Dialogue: 0,0:08:38.00,0:08:43.60,English,,0,0,0,,Ok times 2^E
Dialogue: 0,0:08:38.00,0:08:43.60,Chinese,,0,0,0,,然后乘以 2 的 E 次幂
Dialogue: 0,0:08:43.94,0:08:51.86,English,,0,0,0,,Ok so all of the numbers that we can represent in floating point have to be represented in this form
Dialogue: 0,0:08:43.94,0:08:51.86,Chinese,,0,0,0,,所有浮点数都必须以这种形式表示
Dialogue: 0,0:08:53.04,0:08:59.42,English,,0,0,0,,So the sign bit S determines whether the number is negative or positive obviously
Dialogue: 0,0:08:53.04,0:08:59.42,Chinese,,0,0,0,,显然,符号位 S 确定了该数字是负数还是正数
Dialogue: 0,0:08:59.86,0:09:04.02,English,,0,0,0,,The significand M and this is sometimes sometimes called the mantissa
Dialogue: 0,0:08:59.86,0:09:04.02,Chinese,,0,0,0,,尾数 M,有时叫做 mantissa
Dialogue: 0,0:09:04.02,0:09:05.68,English,,0,0,0,,where the M comes from
Dialogue: 0,0:09:04.02,0:09:05.68,Chinese,,0,0,0,,单词的首字母就是 M 的来源
Dialogue: 0,0:09:06.16,0:09:13.06,English,,0,0,0,,The significand M normally is a fractional value in the range between 1 and 2
Dialogue: 0,0:09:06.16,0:09:13.06,Chinese,,0,0,0,,尾数 M 通常是介于 1 和 2 之间的小数
Dialogue: 0,0:09:13.06,0:09:16.00,English,,0,0,0,,And we'll see why that is in a second
Dialogue: 0,0:09:13.06,0:09:16.00,Chinese,,0,0,0,,接下来,我们会很快看到这样设置的原因
Dialogue: 0,0:09:16.52,0:09:19.88,English,,0,0,0,,And then the exponent E weights the value by some power of 2
Dialogue: 0,0:09:16.52,0:09:19.88,Chinese,,0,0,0,,指数 E 会以 2 的 E 次幂形式扩大或或缩小尾数值
Dialogue: 0,0:09:20.48,0:09:25.76,English,,0,0,0,,Okay so this is encoded in either 32-bit or 64-bit
Dialogue: 0,0:09:20.48,0:09:25.76,Chinese,,0,0,0,,32 位或 64 位编码中都是这样
Dialogue: 0,0:09:26.28,0:09:30.42,English,,0,0,0,,In the following way the the sign bit S is the most significant bit
Dialogue: 0,0:09:26.28,0:09:30.42,Chinese,,0,0,0,,下面的表示中,符号位 S 是最重要的位
Dialogue: 0,0:09:31.26,0:09:34.62,English,,0,0,0,,And then this is followed by some number of
Dialogue: 0,0:09:31.26,0:09:34.62,Chinese,,0,0,0,,紧随其后的
Dialogue: 0,0:09:34.64,0:09:37.86,English,,0,0,0,,by some number of bits called the exp field
Dialogue: 0,0:09:34.64,0:09:37.86,Chinese,,0,0,0,,是一些被称为指数(exp)域的位(阶码)
Dialogue: 0,0:09:38.74,0:09:42.20,English,,0,0,0,,which encodes the exponent E
Dialogue: 0,0:09:38.74,0:09:42.20,Chinese,,0,0,0,,它编码了 E
Dialogue: 0,0:09:43.24,0:09:47.70,English,,0,0,0,,But it's not identical to E,it encodes E, we'll see how that works
Dialogue: 0,0:09:43.24,0:09:47.70,Chinese,,0,0,0,,但编码表示的值与 E的值不同,它只是编码了 E ,我们会看到它是如何起效的
Dialogue: 0,0:09:48.18,0:09:54.54,English,,0,0,0,,And then the frac. And then that's followed the remaining bits are the the frac field
Dialogue: 0,0:09:48.18,0:09:54.54,Chinese,,0,0,0,,后面剩下的比特位是尾数(frac)字段
Dialogue: 0,0:09:55.96,0:09:59.38,English,,0,0,0,,which encodes M but isn't identical to M
Dialogue: 0,0:09:55.96,0:09:59.38,Chinese,,0,0,0,,它编码了 M 但与 M 不完全相同
Dialogue: 0,0:10:02.02,0:10:09.46,English,,0,0,0,,Now we are...IEEE floating point has provides two different kinds of floating-point
Dialogue: 0,0:10:02.02,0:10:09.46,Chinese,,0,0,0,,IEEE 提供了两种不同的浮点数
Dialogue: 0,0:10:09.46,0:10:14.47,English,,0,0,0,,The single precision 32 bits and so-called double precision which is 64 bits
Dialogue: 0,0:10:09.46,0:10:14.47,Chinese,,0,0,0,,单精度 32 位和双精度 64 位
Dialogue: 0,0:10:15.12,0:10:20.38,English,,0,0,0,,There's this funky intel extended precision
Dialogue: 0,0:10:15.12,0:10:20.38,Chinese,,0,0,0,,还有这种特别的英特尔扩展精度
Dialogue: 0,0:10:20.38,0:10:22.84,English,,0,0,0,,which is non-standard and we won't talk about it anymore
Dialogue: 0,0:10:20.38,0:10:22.84,Chinese,,0,0,0,,由于这是非标准的,我们此处不再讨论
Dialogue: 0,0:10:25.18,0:10:27.82,English,,0,0,0,,And so in the single precision 32 bits
Dialogue: 0,0:10:25.18,0:10:27.82,Chinese,,0,0,0,,在 32 位单精度浮点数中
Dialogue: 0,0:10:27.82,0:10:30.30,English,,0,0,0,,You have one sign bit, there's always a sign bit
Dialogue: 0,0:10:27.82,0:10:30.30,Chinese,,0,0,0,,总有一个符号位
Dialogue: 0,0:10:30.30,0:10:34.68,English,,0,0,0,,You have 8 exp bits and you have 23 frac bits
Dialogue: 0,0:10:30.30,0:10:34.68,Chinese,,0,0,0,,还有 8 个阶码位和 23 个尾数位
Dialogue: 0,0:10:35.34,0:10:40.20,English,,0,0,0,,In double precision you have 11 exp and 52 frac bits
Dialogue: 0,0:10:35.34,0:10:40.20,Chinese,,0,0,0,,在双精度中,有 11 个阶码位和 52 个尾数位
Dialogue: 0,0:10:42.58,0:10:47.60,English,,0,0,0,,Now there's a number of different kinds of floating-point representations
Dialogue: 0,0:10:42.58,0:10:47.60,Chinese,,0,0,0,,现在有许多不同类型的浮点表示方法
Dialogue: 0,0:10:48.12,0:10:54.22,English,,0,0,0,,The sort of the default and sort of the common representation is called normalized
Dialogue: 0,0:10:48.12,0:10:54.22,Chinese,,0,0,0,,默认及通用的表示方法被称为规格化的(表示方法)
Dialogue: 0,0:10:55.38,0:10:57.17,English,,0,0,0,,So called normalized values
Dialogue: 0,0:10:55.38,0:10:57.17,Chinese,,0,0,0,,也就是所谓的规格化值
Dialogue: 0,0:10:58.26,0:11:00.28,English,,0,0,0,,And normalized values are
Dialogue: 0,0:10:58.26,0:11:00.28,Chinese,,0,0,0,,规格化值是指
Dialogue: 0,0:11:01.12,0:11:05.46,English,,0,0,0,,All the values where the exp field is not equal to 0
Dialogue: 0,0:11:01.12,0:11:05.46,Chinese,,0,0,0,,其中阶码字段的所有位的值
Dialogue: 0,0:11:06.06,0:11:10.78,English,,0,0,0,,And not equal to all zeros and not equal to all ones
Dialogue: 0,0:11:06.06,0:11:10.78,Chinese,,0,0,0,,不能全是 0 也不能全是 1
Dialogue: 0,0:11:11.46,0:11:17.48,English,,0,0,0,,So everything all zeros and all ones are special kinds of numbers we'll look at a second
Dialogue: 0,0:11:11.46,0:11:17.48,Chinese,,0,0,0,,全 0 和全 1 的情形都是特殊类型的数字,稍后我们会讲到
Dialogue: 0,0:11:18.58,0:11:30.54,English,,0,0,0,,So the exponent...this exponent E remember our numbers are (-1)^S*M*2^E
Dialogue: 0,0:11:18.58,0:11:30.54,Chinese,,0,0,0,,对于公式 (-1)^S*M*2^E 指数 E
Dialogue: 0,0:11:31.36,0:11:42.74,English,,0,0,0,,The exponent E is encoded as this biased value which is the called exp
Dialogue: 0,0:11:31.36,0:11:42.74,Chinese,,0,0,0,,指数 E 被解释为以「偏置(biased)」形式表示
Dialogue: 0,0:11:43.44,0:11:48.06,English,,0,0,0,,So the exponent E is exp-bias
Dialogue: 0,0:11:43.44,0:11:48.06,Chinese,,0,0,0,,所以指数 E 的实际值为 exp-bias
Dialogue: 0,0:11:48.50,0:11:50.88,English,,0,0,0,,And exp is the value
Dialogue: 0,0:11:48.50,0:11:50.88,Chinese,,0,0,0,,而 Exp 的值是
Dialogue: 0,0:11:51.10,0:11:57.56,English,,0,0,0,,Exp is the value of the exp bits, the bits in the exp field treated as a positive number
Dialogue: 0,0:11:51.10,0:11:57.56,Chinese,,0,0,0,,Exp 位的值,也就是把 exp 域的值(一直)作为一个正数
Dialogue: 0,0:11:57.96,0:12:09.72,English,,0,0,0,,Okay so Exp, you just look at it as an unsigned 7-bit in case of single precision 7-bit number
Dialogue: 0,0:11:57.96,0:12:09.72,Chinese,,0,0,0,,所以在单精度 7 位数字的情况下,你只需将它看作 7 位的无符号整数
Dialogue: 0,0:12:11.40,0:12:20.44,English,,0,0,0,,Okay now the Bias=2^(k-1)-1, where k is number of exponent bits
Dialogue: 0,0:12:11.40,0:12:20.44,Chinese,,0,0,0,,现在偏移值 Bias=2^(k-1)-1,其中 k 是阶码域的位数
Dialogue: 0,0:12:21.08,0:12:26.85,English,,0,0,0,,Okay so for single precision we have 8 exponent bits
Dialogue: 0,0:12:21.08,0:12:26.85,Chinese,,0,0,0,,那么,对于单精度,我们有 8 个指数位
Dialogue: 0,0:12:27.72,0:12:39.86,English,,0,0,0,,So 2^8... 2^(8-1=7) so 2^7=128-1 is 127
Dialogue: 0,0:12:27.72,0:12:39.86,Chinese,,0,0,0,,所以 2^(8-1)-1=2^7-1=128-1=127
Dialogue: 0,0:12:40.00,0:12:43.36,English,,0,0,0,,Ok so the Bias for single precision is 127
Dialogue: 0,0:12:40.00,0:12:43.36,Chinese,,0,0,0,,所以单精度的偏移值是 127
Dialogue: 0,0:12:43.88,0:12:47.00,English,,0,0,0,,And similarly for double precision it's 1023
Dialogue: 0,0:12:43.88,0:12:47.00,Chinese,,0,0,0,,同样,对于双精度,它是 1023
Dialogue: 0,0:12:49.82,0:12:54.94,English,,0,0,0,,Okay so you just have to memorize this formula
Dialogue: 0,0:12:49.82,0:12:54.94,Chinese,,0,0,0,,所以你只需要记住这个公式
Dialogue: 0,0:12:54.94,0:13:03.02,English,,0,0,0,,The exponent E is the exp field interpret it as an unsigned number minus the the bias
Dialogue: 0,0:12:54.94,0:13:03.02,Chinese,,0,0,0,,指数 E 的值是无符号 Exp 值减去偏置值 Bias
Dialogue: 0,0:13:04.24,0:13:10.58,English,,0,0,0,,This is kind of a strange thing the first time you encounter floating-point
Dialogue: 0,0:13:04.24,0:13:10.58,Chinese,,0,0,0,,当第一次遇到浮点时
Dialogue: 0,0:13:10.78,0:13:13.66,English,,0,0,0,,It seems kind of odd, right? So why not...
Dialogue: 0,0:13:10.78,0:13:13.66,Chinese,,0,0,0,,不免觉得这似乎有点奇怪,对吧
Dialogue: 0,0:13:14.92,0:13:16.78,English,,0,0,0,,I mean we've already learned about two's complement
Dialogue: 0,0:13:14.92,0:13:16.78,Chinese,,0,0,0,,我的意思是,我们已经学会了二进制补码
Dialogue: 0,0:13:16.78,0:13:20.66,English,,0,0,0,,That's a perfectly fine way to represent positive and negative numbers
Dialogue: 0,0:13:16.78,0:13:20.66,Chinese,,0,0,0,,这是表示正数和负数的完美方式
Dialogue: 0,0:13:21.28,0:13:26.42,English,,0,0,0,,Okay we have exponents that are negative and positive, right
Dialogue: 0,0:13:21.28,0:13:26.42,Chinese,,0,0,0,,既然指数有负的也有正的
Dialogue: 0,0:13:26.42,0:13:29.04,English,,0,0,0,,So why not just use the exp field to represent
Dialogue: 0,0:13:26.42,0:13:29.04,Chinese,,0,0,0,,那为什么不在 exp 域中使用二进制补码
Dialogue: 0,0:13:29.98,0:13:37.12,English,,0,0,0,,Why not just use a two's complement in the exp field to represent those positive and negative exponents, right
Dialogue: 0,0:13:29.98,0:13:37.12,Chinese,,0,0,0,,来表示那些正的和负的指数呢
Dialogue: 0,0:13:37.88,0:13:42.14,English,,0,0,0,,So it turns out that the reason that they do this is
Dialogue: 0,0:13:37.88,0:13:42.14,Chinese,,0,0,0,,事实证明,这样做的原因是
Dialogue: 0,0:13:44.72,0:13:45.72,English,,0,0,0,,is that...
Dialogue: 0,0:13:44.72,0:13:45.72,Chinese,,0,0,0,,就是……
Dialogue: 0,0:13:46.28,0:13:49.72,English,,0,0,0,,And if you think about this and we'll come back to it
Dialogue: 0,0:13:46.28,0:13:49.72,Chinese,,0,0,0,,你不妨考虑考虑这个问题,我们会回过头来讨论
Dialogue: 0,0:13:49.74,0:13:56.90,English,,0,0,0,,But if we encode the the exponent E using this bias representation
Dialogue: 0,0:13:49.74,0:13:56.90,Chinese,,0,0,0,,但是如果我们使用这种偏置值的方式来编码指数 E
Dialogue: 0,0:13:57.82,0:14:02.40,English,,0,0,0,,The smallest negative exponent is represented by all zeros
Dialogue: 0,0:13:57.82,0:14:02.40,Chinese,,0,0,0,,最小的负指数由全 0 表示
Dialogue: 0,0:14:05.10,0:14:12.38,English,,0,0,0,,And the largest exponent is represented by 01...111
Dialogue: 0,0:14:05.10,0:14:12.38,Chinese,,0,0,0,,最大的指数由 01...111 表示
Dialogue: 0,0:14:15.22,0:14:20.64,English,,0,0,0,,So the smallest, the number with the smallest exponent
Dialogue: 0,0:14:15.22,0:14:20.64,Chinese,,0,0,0,,所以最小的指数......
Dialogue: 0,0:14:21.34,0:14:22.98,English,,0,0,0,,If we were just to compare the bits
Dialogue: 0,0:14:21.34,0:14:22.98,Chinese,,0,0,0,,为了比较二进制数
Dialogue: 0,0:14:22.98,0:14:30.12,English,,0,0,0,,using a just some kind of unsigned representation, just comparing the bits, treating it as an unsigned number
Dialogue: 0,0:14:22.98,0:14:30.12,Chinese,,0,0,0,,只需要采用无符号表达,比较各个位,把它当做无符号整数
Dialogue: 0,0:14:30.70,0:14:33.52,English,,0,0,0,,By using this biased representation
Dialogue: 0,0:14:30.70,0:14:33.52,Chinese,,0,0,0,,我们可以通过使用这种偏移值表示法
Dialogue: 0,0:14:33.52,0:14:38.40,English,,0,0,0,,we can just compare two floating-point numbers just as unsigned
Dialogue: 0,0:14:33.52,0:14:38.40,Chinese,,0,0,0,,来比较两个浮点数,就像无符号整数一样
Dialogue: 0,0:14:38.40,0:14:43.10,English,,0,0,0,,We can treat the whole floating-point number as an unsigned integer and compare two numbers
Dialogue: 0,0:14:38.40,0:14:43.10,Chinese,,0,0,0,,我们可以将整个浮点数视为无符号整数并比较这两个数字
Dialogue: 0,0:14:43.50,0:14:46.24,English,,0,0,0,,And get a true comparison
Dialogue: 0,0:14:43.50,0:14:46.24,Chinese,,0,0,0,,就可以得到真正的比较
Dialogue: 0,0:14:50.58,0:14:54.56,English,,0,0,0,,So the exponent uses this this sort of biasing encoding
Dialogue: 0,0:14:50.58,0:14:54.56,Chinese,,0,0,0,,所以指数使用这种偏置编码法
Dialogue: 0,0:14:55.22,0:15:00.98,English,,0,0,0,,And then the significand is encoded with an implied one
Dialogue: 0,0:14:55.22,0:15:00.98,Chinese,,0,0,0,,尾数采用隐含编码法
Dialogue: 0,0:15:01.52,0:15:06.52,English,,0,0,0,,So and this is where the... this is where the normalized
Dialogue: 0,0:15:01.52,0:15:06.52,Chinese,,0,0,0,,这就是
Dialogue: 0,0:15:07.04,0:15:09.04,English,,0,0,0,,... and the normalized representation comes from
Dialogue: 0,0:15:07.04,0:15:09.04,Chinese,,0,0,0,,规格化表示的来源
Dialogue: 0,0:15:09.70,0:15:11.84,English,,0,0,0,,That we're always going to represent our numbers
Dialogue: 0,0:15:09.70,0:15:11.84,Chinese,,0,0,0,,这是我们想表达数字的方法
Dialogue: 0,0:15:12.44,0:15:16.74,English,,0,0,0,,So M... we're always going to normalize M
Dialogue: 0,0:15:12.44,0:15:16.74,Chinese,,0,0,0,,所以我们总是要将 M 规格化
Dialogue: 0,0:15:16.74,0:15:19.24,English,,0,0,0,,no matter what the number we want to represent
Dialogue: 0,0:15:16.74,0:15:19.24,Chinese,,0,0,0,,无论我们想要表示什么数字
Dialogue: 0,0:15:19.24,0:15:23.26,English,,0,0,0,,We're always going to normalize M as 1.xxx...x
Dialogue: 0,0:15:19.24,0:15:23.26,Chinese,,0,0,0,,我们总是将 M 规格化为 1.xxx...x
Dialogue: 0,0:15:23.98,0:15:26.52,English,,0,0,0,,And then we adjust the exponent accordingly
Dialogue: 0,0:15:23.98,0:15:26.52,Chinese,,0,0,0,,我们相应地调整指数(来进行规格化)
Dialogue: 0,0:15:26.94,0:15:32.66,English,,0,0,0,,So if the value we want to represent is 100.01
Dialogue: 0,0:15:26.94,0:15:32.66,Chinese,,0,0,0,,因此,如果我们想要表示的值是 100.01
Dialogue: 0,0:15:33.56,0:15:37.68,English,,0,0,0,,We're going to shift it over and it will be 1.00
Dialogue: 0,0:15:33.56,0:15:37.68,Chinese,,0,0,0,,我们将把它的二进制小数点左移,使之成为 1.00
Dialogue: 0,0:15:40.60,0:15:45.04,English,,0,0,0,,Okay and then we'll adjust the exponent to represent that shift
Dialogue: 0,0:15:40.60,0:15:45.04,Chinese,,0,0,0,,然后我们调整指数来表示这种位移
Dialogue: 0,0:15:47.44,0:15:54.34,English,,0,0,0,,Okay so the bits in the frac field xxxx...x are
Dialogue: 0,0:15:47.44,0:15:54.34,Chinese,,0,0,0,,那么,尾数域 xxxx...x 中的位是
Dialogue: 0,0:15:54.86,0:15:58.10,English,,0,0,0,,All of the numbers to the right of the binary point right
Dialogue: 0,0:15:54.86,0:15:58.10,Chinese,,0,0,0,,二进制点右边的所有数字
Dialogue: 0,0:15:58.10,0:16:00.18,English,,0,0,0,,So there's always this implied one
Dialogue: 0,0:15:58.10,0:16:00.18,Chinese,,0,0,0,,这个1一直隐藏的
Dialogue: 0,0:16:01.48,0:16:03.52,English,,0,0,0,,But we don't even encode it we just throw it away
Dialogue: 0,0:16:01.48,0:16:03.52,Chinese,,0,0,0,,我们甚至没有对它进行编码,我们只是扔掉它(不对这个1进行存储)
Dialogue: 0,0:16:03.52,0:16:05.14,English,,0,0,0,,Because it's always there right
Dialogue: 0,0:16:03.52,0:16:05.14,Chinese,,0,0,0,,因为它总是在那里
Dialogue: 0,0:16:05.14,0:16:08.90,English,,0,0,0,,So this is a little trick just to get it one more bit for free
Dialogue: 0,0:16:05.14,0:16:08.90,Chinese,,0,0,0,,所以这是一个小技巧,只是为了免费获得一位
Dialogue: 0,0:16:10.18,0:16:14.40,English,,0,0,0,,Okay so the the xxx bits in the frac field
Dialogue: 0,0:16:10.18,0:16:14.40,Chinese,,0,0,0,,好吧,尾数域的 xxx 位
Dialogue: 0,0:16:15.06,0:16:21.72,English,,0,0,0,,All the bits to the right of the binary point after one point the one point
Dialogue: 0,0:16:15.06,0:16:21.72,Chinese,,0,0,0,,二进制小数点之后的所有位在 1. 之后
Dialogue: 0,0:16:22.66,0:16:27.54,English,,0,0,0,,And this is,the so this is the smallest fractal is all zeros
Dialogue: 0,0:16:22.66,0:16:27.54,Chinese,,0,0,0,,所以最小的尾数域全是 0
Dialogue: 0,0:16:27.56,0:16:31.10,English,,0,0,0,, Which corresponds to a significand of 1.0
Dialogue: 0,0:16:27.56,0:16:31.10,Chinese,,0,0,0,,这相当于尾数是 1.0
Dialogue: 0,0:16:34.26,0:16:39.64,English,,0,0,0,,A frac field of all ones corresponds to 2-ɛ
Dialogue: 0,0:16:34.26,0:16:39.64,Chinese,,0,0,0,,所有位都是 1 的 frac 对应于 2-ɛ
Dialogue: 0,0:16:39.64,0:16:43.04,English,,0,0,0,,So that's 1.111...
Dialogue: 0,0:16:39.64,0:16:43.04,Chinese,,0,0,0,,那是 1.111......
Dialogue: 0,0:16:47.08,0:16:50.64,English,,0,0,0,,So let's look at an example
Dialogue: 0,0:16:47.08,0:16:50.64,Chinese,,0,0,0,,那么让我们看一个例子
Dialogue: 0,0:16:51.82,0:17:01.12,English,,0,0,0,,So let's look at how we would encode 15213 which our favorite number In two's complement in floating point
Dialogue: 0,0:16:51.82,0:17:01.12,Chinese,,0,0,0,,那么让我们来看看如何使用浮点数的方式来编码我们最喜欢的数字 15213
Dialogue: 0,0:17:02.52,0:17:05.22,English,,0,0,0,,So the if we represent that so it's an integer
Dialogue: 0,0:17:02.52,0:17:05.22,Chinese,,0,0,0,,如果我们使用这种发式表达它,它就是一个整数
Dialogue: 0,0:17:06.60,0:17:15.34,English,,0,0,0,,And we represent it using these bits take my word for it correspond to the integer 15213
Dialogue: 0,0:17:06.60,0:17:15.34,Chinese,,0,0,0,,我们使用这些位表示它,它对应于整数 15213
Dialogue: 0,0:17:16.22,0:17:18.56,English,,0,0,0,,So now we want to convert it we want to normalize it
Dialogue: 0,0:17:16.22,0:17:18.56,Chinese,,0,0,0,,现在我们要转换它,我们想要标准化它
Dialogue: 0,0:17:20.88,0:17:26.70,English,,0,0,0,, By expressing it as 1.110xxx * 2^13
Dialogue: 0,0:17:20.88,0:17:26.70,Chinese,,0,0,0,,通过将其表示为 1.110xxx*2^13
Dialogue: 0,0:17:27.22,0:17:29.50,English,,0,0,0,,Okay same number we just normalized it
Dialogue: 0,0:17:27.22,0:17:29.50,Chinese,,0,0,0,,这是相同的数字,我们只是将其规格化了
Dialogue: 0,0:17:29.78,0:17:32.26,English,,0,0,0,,So that there's always this leading 1
Dialogue: 0,0:17:29.78,0:17:32.26,Chinese,,0,0,0,,所以总是有这个开头的 1
Dialogue: 0,0:17:36.76,0:17:45.62,English,,0,0,0,, So the significant m is 1.11011xxx
Dialogue: 0,0:17:36.76,0:17:45.62,Chinese,,0,0,0,,所以尾数 m 是 1.11011xxx
Dialogue: 0,0:17:46.74,0:17:50.78,English,,0,0,0,,The frac field is everything to the right of the binary point
Dialogue: 0,0:17:46.74,0:17:50.78,Chinese,,0,0,0,,二进制小数点右侧的内容对应着尾数域
Dialogue: 0,0:17:50.94,0:17:54.60,English,,0,0,0,,So we just,we throw this one away
Dialogue: 0,0:17:50.94,0:17:54.60,Chinese,,0,0,0,,所以我们可以把这个 1 忽略掉
Dialogue: 0,0:17:54.60,0:17:59.44,English,,0,0,0,,And we just take the the values to the right of the binary point
Dialogue: 0,0:17:54.60,0:17:59.44,Chinese,,0,0,0,,我们只需取得二进制点的右侧的值
Dialogue: 0,0:17:59.74,0:18:04.62,English,,0,0,0,,And then we pat it out with zeros to get the 23 bits that we need for single precision
Dialogue: 0,0:17:59.74,0:18:04.62,Chinese,,0,0,0,,然后我们用零来补全它以获得我们需要的单精度浮点数的 23 位
Dialogue: 0,0:18:07.40,0:18:09.10,English,,0,0,0,, Ok so now we've got our frac field
Dialogue: 0,0:18:07.40,0:18:09.10,Chinese,,0,0,0,,好的,现在我们有了尾数域
Dialogue: 0,0:18:11.14,0:18:12.22,English,,0,0,0,, The exponent
Dialogue: 0,0:18:11.14,0:18:12.22,Chinese,,0,0,0,,指数
Dialogue: 0,0:18:13.12,0:18:15.74,English,,0,0,0,,So in this case right E is
Dialogue: 0,0:18:13.12,0:18:15.74,Chinese,,0,0,0,,所以在这种情况下,E 是
Dialogue: 0,0:18:16.98,0:18:20.72,English,,0,0,0,,We're multiplying by 2 ^13.So E is 13
Dialogue: 0,0:18:16.98,0:18:20.72,Chinese,,0,0,0,,我们乘以 2^13, 所以 E 是 13
Dialogue: 0,0:18:21.26,0:18:25.36,English,,0,0,0,,So we want to represent the value 13 using this bias encoding
Dialogue: 0,0:18:21.26,0:18:25.36,Chinese,,0,0,0,,因此,我们希望使用此偏置编码来表示值 13
Dialogue: 0,0:18:27.84,0:18:29.86,English,,0,0,0,,So the bias is 127
Dialogue: 0,0:18:27.84,0:18:29.86,Chinese,,0,0,0,,所以偏置值是 127
Dialogue: 0,0:18:32.26,0:18:41.38,English,,0,0,0,,And so the exponent the value...the value of the exp field should be 140
Dialogue: 0,0:18:32.26,0:18:41.38,Chinese,,0,0,0,,所以 exp 域的值应该是 140
Dialogue: 0,0:18:41.58,0:18:49.32,English,,0,0,0,,Because if we take 140-127 we get 13
Dialogue: 0,0:18:41.58,0:18:49.32,Chinese,,0,0,0,,因为如果我们拿 140-127 就会得到 13
Dialogue: 0,0:18:50.98,0:18:54.52,English,,0,0,0,,Okay so 140 is represented using these 8 bits
Dialogue: 0,0:18:50.98,0:18:54.52,Chinese,,0,0,0,,好的,所以使用这 8 位表示 140
Dialogue: 0,0:18:55.58,0:18:58.02,English,,0,0,0,,And that becomes our exp field
Dialogue: 0,0:18:55.58,0:18:58.02,Chinese,,0,0,0,,这就成了我们的阶码字段
Dialogue: 0,0:19:00.02,0:19:01.92,English,,0,0,0,, Okay so the resulting floating-point number
Dialogue: 0,0:19:00.02,0:19:01.92,Chinese,,0,0,0,,好的,所以得到的浮点数
Dialogue: 0,0:19:01.92,0:19:05.08,English,,0,0,0,, And of course it's a positive number so the significand bit is zero
Dialogue: 0,0:19:01.92,0:19:05.08,Chinese,,0,0,0,,符号位为零,因此是一个正数
Dialogue: 0,0:19:06.96,0:19:09.72,English,,0,0,0,, So the resulting floating point number has these eight
Dialogue: 0,0:19:06.96,0:19:09.72,Chinese,,0,0,0,,因此得到的浮点数有 8 位 exp
Dialogue: 0,0:19:10.30,0:19:19.30,English,,0,0,0,,The 8 bits and exp field that we computed by subtracting 127 from 140
Dialogue: 0,0:19:10.30,0:19:19.30,Chinese,,0,0,0,,我们通过从 140 减去 127 来计算阶码的值
Dialogue: 0,0:19:20.00,0:19:27.68,English,,0,0,0,,And then the frack field are these bits that we got here by just taking everything to the right of the binary point
Dialogue: 0,0:19:20.00,0:19:27.68,Chinese,,0,0,0,,我们将所有内容都放在二进制点右侧而得到的这些位就是小数字段
Dialogue: 0,0:19:32.12,0:19:33.10,English,,0,0,0,, So this...
Dialogue: 0,0:19:32.12,0:19:33.10,Chinese,,0,0,0,,所以这...
Dialogue: 0,0:19:35.88,0:19:38.18,English,,0,0,0,,So let's look at this exponent just a little bit more
Dialogue: 0,0:19:35.88,0:19:38.18,Chinese,,0,0,0,,让我们再看一下这个指数吧
Dialogue: 0,0:19:38.18,0:19:41.80,English,,0,0,0,,Because I think can be a little confusing
Dialogue: 0,0:19:38.18,0:19:41.80,Chinese,,0,0,0,,因为我觉得可能有点令人困惑
Dialogue: 0,0:19:46.90,0:19:54.94,English,,0,0,0,,So in our example
Dialogue: 0,0:19:46.90,0:19:54.94,Chinese,,0,0,0,,所以在我们的例子中
Dialogue: 0,0:19:55.02,0:20:00.32,English,,0,0,0,,If we want to look at the range of Exp
Dialogue: 0,0:19:55.02,0:20:00.32,Chinese,,0,0,0,,如果我们想看看 Exp 的范围
Dialogue: 0,0:20:00.32,0:20:07.14,English,,0,0,0,,So what's the smallest value of exp
Dialogue: 0,0:20:00.32,0:20:07.14,Chinese,,0,0,0,,那么 Exp 的最小值是多少
Dialogue: 0,0:20:07.26,0:20:09.04,English,,0,0,0,,What's the smallest value of exp?
Dialogue: 0,0:20:07.26,0:20:09.04,Chinese,,0,0,0,,Exp 的最小值是多少?
Dialogue: 0,0:20:10.82,0:20:14.86,English,,0,0,0,,Don't confuse the encoding with the value it represents
Dialogue: 0,0:20:10.82,0:20:14.86,Chinese,,0,0,0,,不要将编码值与它的实际值混淆
Dialogue: 0,0:20:15.38,0:20:17.60,English,,0,0,0,, Exp is just the encoding
Dialogue: 0,0:20:15.38,0:20:17.60,Chinese,,0,0,0,,Exp 只是编码
Dialogue: 0,0:20:17.70,0:20:21.14,English,,0,0,0,,So what's... what's the smallest value of exp?
Dialogue: 0,0:20:17.70,0:20:21.14,Chinese,,0,0,0,,那么......exp 的最小值是什么?
Dialogue: 0,0:20:22.02,0:20:26.08,English,,0,0,0,, 0 that's right
Dialogue: 0,0:20:22.02,0:20:26.08,Chinese,,0,0,0,,0 那是对的
Dialogue: 0,0:20:26.18,0:20:29.82,English,,0,0,0,,Okay and the largest value is? is what?
Dialogue: 0,0:20:26.18,0:20:29.82,Chinese,,0,0,0,,好的,最大的值是什么?
Dialogue: 0,0:20:29.82,0:20:34.56,English,,0,0,0,,It's... what's the largest value?
Dialogue: 0,0:20:29.82,0:20:34.56,Chinese,,0,0,0,,这是......最大的值是什么?
Dialogue: 0,0:20:34.76,0:20:35.62,English,,0,0,0,,Yes
Dialogue: 0,0:20:34.76,0:20:35.62,Chinese,,0,0,0,,是
Dialogue: 0,0:20:35.62,0:20:38.22,English,,0,0,0,,[student speaking]
Dialogue: 0,0:20:35.62,0:20:38.22,Chinese,,0,0,0,,[学生说话]
Dialogue: 0,0:20:38.22,0:20:43.88,English,,0,0,0,,Well the largest value would be remember it can't be all ones
Dialogue: 0,0:20:38.22,0:20:43.88,Chinese,,0,0,0,,那么最大的值就是记住它不可能每个位全是 1
Dialogue: 0,0:20:45.72,0:20:48.94,English,,0,0,0,,Right so the largest value would be 2^8-1
Dialogue: 0,0:20:45.72,0:20:48.94,Chinese,,0,0,0,,正确,因此最大值为 2^8-1
Dialogue: 0,0:20:51.04,0:20:55.32,English,,0,0,0,,So okay so the largest value would be 01111...
Dialogue: 0,0:20:51.04,0:20:55.32,Chinese,,0,0,0,,好吧所以最大的值是 01111......
Dialogue: 0,0:20:55.32,0:20:57.20,English,,0,0,0,,0 followed by 7 ones
Dialogue: 0,0:20:55.32,0:20:57.20,Chinese,,0,0,0,,0 后跟 7 个 1
Dialogue: 0,0:20:59.88,0:21:03.62,English,,0,0,0,,So that's a 2^8-1 is ...
Dialogue: 0,0:20:59.88,0:21:03.62,Chinese,,0,0,0,,那是 2^8-1 是......
Dialogue: 0,0:21:03.64,0:21:13.06,English,,0,0,0,,255 good
Dialogue: 0,0:21:03.64,0:21:13.06,Chinese,,0,0,0,,255
Dialogue: 0,0:21:13.12,0:21:16.42,English,,0,0,0,,Okay so then what's the range the of E
Dialogue: 0,0:21:13.12,0:21:16.42,Chinese,,0,0,0,,那么那么 E 的范围是什么呢?
Dialogue: 0,0:21:16.56,0:21:19.90,English,,0,0,0,,Which is the actual value that we want to encode
Dialogue: 0,0:21:16.56,0:21:19.90,Chinese,,0,0,0,,也就是我们想要编码的实际值
Dialogue: 0,0:21:24.28,0:21:26.94,English,,0,0,0,,Okay member use this we have this definition
Dialogue: 0,0:21:24.28,0:21:26.94,Chinese,,0,0,0,,我们有这个定义
Dialogue: 0,0:21:27.54,0:21:29.98,English,,0,0,0,,So we have the range of values for exp
Dialogue: 0,0:21:27.54,0:21:29.98,Chinese,,0,0,0,,所以我们有 Exp 的值范围
Dialogue: 0,0:21:30.46,0:21:32.52,English,,0,0,0,,We have our bias
Dialogue: 0,0:21:30.46,0:21:32.52,Chinese,,0,0,0,,我们有偏置值
Dialogue: 0,0:21:32.52,0:21:34.64,English,,0,0,0,,So what is the range of values for E
Dialogue: 0,0:21:32.52,0:21:34.64,Chinese,,0,0,0,,那么 E 的值范围是多少?
Dialogue: 0,0:21:34.64,0:21:37.66,English,,0,0,0,,This is the actual exponents that we're encoding
Dialogue: 0,0:21:34.64,0:21:37.66,Chinese,,0,0,0,,这是我们编码的实际指数
Dialogue: 0,0:21:38.74,0:21:47.20,English,,0,0,0,,So what's the smallest exponent,-127 good
Dialogue: 0,0:21:38.74,0:21:47.20,Chinese,,0,0,0,,那么什么是最小的指数,-127,对
Dialogue: 0,0:21:47.36,0:21:53.66,English,,0,0,0,,Right because that's zero is our smallest exp-bias which is -127
Dialogue: 0,0:21:47.36,0:21:53.66,Chinese,,0,0,0,,因为零是我们最小的 Exp-bias,即 -127
Dialogue: 0,0:21:53.66,0:21:59.06,English,,0,0,0,,Okay so the smallest value of E is 127
Dialogue: 0,0:21:53.66,0:21:59.06,Chinese,,0,0,0,,好的,所以 E 的最小值是 127(应该是 -127)
Dialogue: 0,0:21:59.06,0:22:02.42,English,,0,0,0,,And the largest value of E is ?
Dialogue: 0,0:21:59.06,0:22:02.42,Chinese,,0,0,0,,E的最大值是?
Dialogue: 0,0:22:08.64,0:22:25.16,English,,0,0,0,,So if we take the largest value of exp that's 255-127=128
Dialogue: 0,0:22:08.64,0:22:25.16,Chinese,,0,0,0,,因此,如果我们取 Exp 的最大值为 255-127=128
Dialogue: 0,0:22:25.16,0:22:30.80,English,,0,0,0,,Okay so the numbers that we can represent using this bias notation
Dialogue: 0,0:22:25.16,0:22:30.80,Chinese,,0,0,0,,好的,我们可以使用这种偏置表示法表示的数字
Dialogue: 0,0:22:31.70,0:22:35.40,English,,0,0,0,,We have the smallest exponent will be 2^ -127
Dialogue: 0,0:22:31.70,0:22:35.40,Chinese,,0,0,0,,我们有最小的指数将是 -127
Dialogue: 0,0:22:36.12,0:22:41.65,English,,0,0,0,,And the largest exponent will be 2 to the raised to the power 128
Dialogue: 0,0:22:36.12,0:22:41.65,Chinese,,0,0,0,,并且最大指数将是 128
Dialogue: 0,0:22:42.40,0:22:46.24,English,,0,0,0,,Okay so you see what's going on here
Dialogue: 0,0:22:42.40,0:22:46.24,Chinese,,0,0,0,,好的,所以你看看这里发生了什么
Dialogue: 0,0:22:46.24,0:22:49.78,English,,0,0,0,,So we have a range of values for E
Dialogue: 0,0:22:46.24,0:22:49.78,Chinese,,0,0,0,,所以我们有一系列的 E 值
Dialogue: 0,0:22:49.96,0:22:54.74,English,,0,0,0,,Here's the largest value,here's the smallest value,here's 0 right in the middle
Dialogue: 0,0:22:49.96,0:22:54.74,Chinese,,0,0,0,,这是最大的值,这里是最小值,中间是 0
Dialogue: 0,0:22:55.30,0:22:58.52,English,,0,0,0,,These are the values we want to represent this biasing is like a shift
Dialogue: 0,0:22:55.30,0:22:58.52,Chinese,,0,0,0,,这些是我们想要表示这种偏置的值
Dialogue: 0,0:22:59.08,0:23:03.40,English,,0,0,0,, We've just now we're shifting up by 127
Dialogue: 0,0:22:59.08,0:23:03.40,Chinese,,0,0,0,,我们刚才将 E 的范围移动 127
Dialogue: 0,0:23:03.62,0:23:07.32,English,,0,0,0,,So that now the smallest exponent is represented by 0
Dialogue: 0,0:23:03.62,0:23:07.32,Chinese,,0,0,0,,所以现在最小的指数用 0 表示
Dialogue: 0,0:23:09.50,0:23:13.34,English,,0,0,0,,Okay any questions about that
Dialogue: 0,0:23:09.50,0:23:13.34,Chinese,,0,0,0,,好的,对此有任何疑问
Dialogue: 0,0:23:23.20,0:23:30.66,English,,0,0,0,,Now these normalized values always have this implied one
Dialogue: 0,0:23:23.20,0:23:30.66,Chinese,,0,0,0,,现在这些规格化值尾数总是有一个隐含的 1
Dialogue: 0,0:23:31.68,0:23:36.92,English,,0,0,0,,Okay which... when we want to represent numbers closer to zero
Dialogue: 0,0:23:31.68,0:23:36.92,Chinese,,0,0,0,,好的...当我们想要表示接近零的数字时
Dialogue: 0,0:23:37.22,0:23:40.22,English,,0,0,0,,That limits us right
Dialogue: 0,0:23:37.22,0:23:40.22,Chinese,,0,0,0,,这(个隐含的 1 )限制了我们
Dialogue: 0,0:23:40.22,0:23:46.40,English,,0,0,0,,So there's another type of floating-point number called the denormalized value
Dialogue: 0,0:23:40.22,0:23:46.40,Chinese,,0,0,0,,所以还有另一种称为非规格化的浮点数
Dialogue: 0,0:23:47.18,0:23:50.94,English,,0,0,0,,Which is characterized by an exp field of all 0
Dialogue: 0,0:23:47.18,0:23:50.94,Chinese,,0,0,0,,其特征在于 exp 域全为 0
Dialogue: 0,0:23:52.72,0:23:58.42,English,,0,0,0,,And in a denormalized number or denorm there's no implied one
Dialogue: 0,0:23:52.72,0:23:58.42,Chinese,,0,0,0,,在非标准化值中,没有隐含的数字 1
Dialogue: 0,0:23:59.20,0:24:09.24,English,,0,0,0,,Okay so the the significant m is represented exactly is encoded identically in the frac field
Dialogue: 0,0:23:59.20,0:24:09.24,Chinese,,0,0,0,,所以尾数 M 的值 frac 域编码值完全等价
Dialogue: 0,0:24:09.98,0:24:11.38,English,,0,0,0,,So there's no implied one
Dialogue: 0,0:24:09.98,0:24:11.38,Chinese,,0,0,0,,所以没有隐藏的 1
Dialogue: 0,0:24:12.08,0:24:18.56,English,,0,0,0,,And all of the numbers are the form zero point something something something after them
Dialogue: 0,0:24:12.08,0:24:18.56,Chinese,,0,0,0,,并且所有数字都是 0.xxx 形式的东西
Dialogue: 0,0:24:21.18,0:24:28.58,English,,0,0,0,,And the exponent value E instead of you remember for denorms we subtracted bias from exp
Dialogue: 0,0:24:21.18,0:24:28.58,Chinese,,0,0,0,,并且指数值 E 不是规格化的值那样等于 Exp 减去偏置 bias
Dialogue: 0,0:24:29.18,0:24:33.64,English,,0,0,0,, For denorm we subtract the bias from one
Dialogue: 0,0:24:29.18,0:24:33.64,Chinese,,0,0,0,,对于非规格化值,E=1-bias
Dialogue: 0,0:24:33.68,0:24:37.12,English,,0,0,0,,Okay now if we just use the definition
Dialogue: 0,0:24:33.68,0:24:37.12,Chinese,,0,0,0,,好的,现在我们使用这个定义
Dialogue: 0,0:24:37.12,0:24:40.86,English,,0,0,0,,We use for normalized numbers that would be...exp would be zero
Dialogue: 0,0:24:37.12,0:24:40.86,Chinese,,0,0,0,,我们使用的规格化数字将是...... exp 将为 0
Dialogue: 0,0:24:41.88,0:24:45.18,English,,0,0,0,,So we don't do that instead
Dialogue: 0,0:24:41.88,0:24:45.18,Chinese,,0,0,0,,所以我们不这样做
Dialogue: 0,0:24:45.92,0:24:47.72,English,,0,0,0,,E = 1 - bias
Dialogue: 0,0:24:45.92,0:24:47.72,Chinese,,0,0,0,,(非规格化数中)E=1-bias
Dialogue: 0,0:24:49.18,0:24:54.78,English,,0,0,0,,And then the significant is coded with an implied leading 0 instead of a leading one like a mentioned
Dialogue: 0,0:24:49.18,0:24:54.78,Chinese,,0,0,0,,然后,符号用隐含的前导 0 编码,而不是如前所述的前导 1
Dialogue: 0,0:24:57.98,0:25:02.86,English,,0,0,0,,So when exp is zero and also I mean
Dialogue: 0,0:24:57.98,0:25:02.86,Chinese,,0,0,0,,因此当 exp 为零时,我的意思是
Dialogue: 0,0:25:02.86,0:25:08.06,English,,0,0,0,,We think about it. If we only had normalized numbers
Dialogue: 0,0:25:02.86,0:25:08.06,Chinese,,0,0,0,,我们考虑一下。如果我们只有规格化的值(老师口误,说成denormalized)
Dialogue: 0,0:25:08.06,0:25:12.58,English,,0,0,0,, We wouldn't be able to represent zero right because there'd always be a 1 in there
Dialogue: 0,0:25:08.06,0:25:12.58,Chinese,,0,0,0,,我们无法代表零,因为总有一个隐含的 1
Dialogue: 0,0:25:13.72,0:25:16.92,English,,0,0,0,, So the denorms allow us to represent zero
Dialogue: 0,0:25:13.72,0:25:16.92,Chinese,,0,0,0,,因此,这些非标准化的值使我们能够代表零
Dialogue: 0,0:25:16.92,0:25:20.96,English,,0,0,0,,And they allow us to represent values that are very close to zero
Dialogue: 0,0:25:16.92,0:25:20.96,Chinese,,0,0,0,,它们允许我们表示非常接近零的值
Dialogue: 0,0:25:22.70,0:25:24.26,English,,0,0,0,,So when the exponent is zero
Dialogue: 0,0:25:22.70,0:25:24.26,Chinese,,0,0,0,,所以当指数为零时
Dialogue: 0,0:25:24.52,0:25:29.74,English,,0,0,0,, And the exp field is zero and the frac field is zero then this is the zero value
Dialogue: 0,0:25:24.52,0:25:29.74,Chinese,,0,0,0,,exp 字段为零,frac 为零,则为零值
Dialogue: 0,0:25:30.60,0:25:35.08,English,,0,0,0,,And so this is nice because all zeros represents zero
Dialogue: 0,0:25:30.60,0:25:35.08,Chinese,,0,0,0,,所以这很好,因为全零代表零
Dialogue: 0,0:25:35.12,0:25:37.22,English,,0,0,0,,Which is you know sort of which one
Dialogue: 0,0:25:35.12,0:25:37.22,Chinese,,0,0,0,,你知道哪一种
Dialogue: 0,0:25:38.56,0:25:40.42,English,,0,0,0,,There is the sort of weird thing though that
Dialogue: 0,0:25:38.56,0:25:40.42,Chinese,,0,0,0,,尽管如此,有一种奇怪的东西
Dialogue: 0,0:25:41.08,0:25:46.48,English,,0,0,0,,If you have a the sign bit is 1
Dialogue: 0,0:25:41.08,0:25:46.48,Chinese,,0,0,0,,如果你有一个符号位是 1
Dialogue: 0,0:25:46.48,0:25:52.32,English,,0,0,0,,And then your frac and exp is 0 then you have -0
Dialogue: 0,0:25:46.48,0:25:52.32,Chinese,,0,0,0,,然后你的 frac 和 exp 为 0 然后你有 -0
Dialogue: 0,0:25:52.32,0:25:55.58,English,,0,0,0,, So you have this kind of odd situation where there's a positive and negative zero
Dialogue: 0,0:25:52.32,0:25:55.58,Chinese,,0,0,0,,所以你有这种奇怪的情况,那里有正负零
Dialogue: 0,0:26:00.42,0:26:04.34,English,,0,0,0,,Okay and other values if exp is zero and you have a nonzero frac
Dialogue: 0,0:26:00.42,0:26:04.34,Chinese,,0,0,0,,好吧和其他值,如果 exp 为零,你有一个非零小数
Dialogue: 0,0:26:04.34,0:26:08.98,English,,0,0,0,,And those are the equally spaced numbers that are closest to zero
Dialogue: 0,0:26:04.34,0:26:08.98,Chinese,,0,0,0,,那些是最接近零的等间距数字
Dialogue: 0,0:26:12.14,0:26:14.86,English,,0,0,0,,Now there's a couple of other special values
Dialogue: 0,0:26:12.14,0:26:14.86,Chinese,,0,0,0,,现在还有其他几个特殊的值
Dialogue: 0,0:26:15.04,0:26:21.14,English,,0,0,0,,When exp is all ones and frac is all zeros
Dialogue: 0,0:26:15.04,0:26:21.14,Chinese,,0,0,0,,当 exp 为全 1 时,frac 全为 0
Dialogue: 0,0:26:21.14,0:26:23.08,English,,0,0,0,,This represents the value infinity
Dialogue: 0,0:26:21.14,0:26:23.08,Chinese,,0,0,0,,这代表无穷大的值
Dialogue: 0,0:26:24.78,0:26:27.44,English,,0,0,0,,So this is a value that that we get
Dialogue: 0,0:26:24.78,0:26:27.44,Chinese,,0,0,0,,这是当
Dialogue: 0,0:26:27.44,0:26:31.66,English,,0,0,0,,When is some kind of addition or multiplication and we overflow
Dialogue: 0,0:26:27.44,0:26:31.66,Chinese,,0,0,0,,因为加法或乘法而且溢出时得到的值(无穷大)
Dialogue: 0,0:26:32.46,0:26:38.48,English,,0,0,0,, So in floating point always overflows to the special value called infinity there positive or negative infinity
Dialogue: 0,0:26:32.46,0:26:38.48,Chinese,,0,0,0,,所以在浮点上总是溢出到称为无穷大的特殊值,有正或负无穷大
Dialogue: 0,0:26:38.74,0:26:41.02,English,,0,0,0,,So it's different from two's complement right where
Dialogue: 0,0:26:38.74,0:26:41.02,Chinese,,0,0,0,,所以它与二进制补码的不同之处在于
Dialogue: 0,0:26:41.44,0:26:48.52,English,,0,0,0,,You sort of overflowed into in this modular way back just back it round into the range of numbers
Dialogue: 0,0:26:41.44,0:26:48.52,Chinese,,0,0,0,,你可以用这种模块化的方式回推,然后回到数字范围内
Dialogue: 0,0:26:48.52,0:26:56.54,English,,0,0,0,, In floating point we just overflow to the sticky value called infinity and then everything we do on that remains infinity
Dialogue: 0,0:26:48.52,0:26:56.54,Chinese,,0,0,0,,在浮点数中,我们会溢出到称为无穷大,然后我们对其做任何操作结果仍然是无穷大
Dialogue: 0,0:26:59.80,0:27:01.62,English,,0,0,0,, So for example if we did...
Dialogue: 0,0:26:59.80,0:27:01.62,Chinese,,0,0,0,,例如,如果我们做了......
Dialogue: 0,0:27:06.70,0:27:14.84,English,,0,0,0,, If we did 1/0 or -1/-0 we'd get positive infinity
Dialogue: 0,0:27:06.70,0:27:14.84,Chinese,,0,0,0,,如果我们做了 1/0 或 -1/-0,我们就得到正无穷大
Dialogue: 0,0:27:14.84,0:27:19.46,English,,0,0,0,, If we divide 1 by 0 negative 0 we get negative infinity
Dialogue: 0,0:27:14.84,0:27:19.46,Chinese,,0,0,0,,如果我们将 1/-0,我们得到负无穷大
Dialogue: 0,0:27:20.72,0:27:33.06,English,,0,0,0,,The fourth kind of special case special number is the case where the exponent again is all once but the frac is nonzero in a nonzero value
Dialogue: 0,0:27:20.72,0:27:33.06,Chinese,,0,0,0,,第四种特殊数字是指数全部是 1 但小数字段非零值的情况
Dialogue: 0,0:27:33.26,0:27:36.56,English,,0,0,0,,And this represents what's called not a number so this is
Dialogue: 0,0:27:33.26,0:27:36.56,Chinese,,0,0,0,,这代表了非数字(NaN)的情况
Dialogue: 0,0:27:37.22,0:27:41.92,English,,0,0,0,,This handles cases where there's no,there's no answer
Dialogue: 0,0:27:37.22,0:27:41.92,Chinese,,0,0,0,,这个值代表了没有答案的情况
Dialogue: 0,0:27:41.92,0:27:46.52,English,,0,0,0,,There's no feasible answer for example if we you know try to take the square root of -1
Dialogue: 0,0:27:41.92,0:27:46.52,Chinese,,0,0,0,,例如,如果我们尝试取 -1 的平方根,就没有可行的答案
Dialogue: 0,0:27:46.84,0:27:49.10,English,,0,0,0,,What we'll get back is not a number
Dialogue: 0,0:27:46.84,0:27:49.10,Chinese,,0,0,0,,我们得到的不是数字
Dialogue: 0,0:27:55.26,0:28:02.10,English,,0,0,0,,So I think it's helpful to to visualize these the number line now so the
Dialogue: 0,0:27:55.26,0:28:02.10,Chinese,,0,0,0,,我认为将这些数字可视化是有帮助的
Dialogue: 0,0:28:02.86,0:28:11.48,English,,0,0,0,,We have +0,-0 sort of right next to each other and then to the right of that are the positive denorms
Dialogue: 0,0:28:02.86,0:28:11.48,Chinese,,0,0,0,,我们有 0,-0 彼此相邻,然后在右边是正的非标准化值
Dialogue: 0,0:28:13.14,0:28:19.54,English,,0,0,0,,And then those sort of transition into the normalized numbers
Dialogue: 0,0:28:13.14,0:28:19.54,Chinese,,0,0,0,,然后过渡到标准化数字
Dialogue: 0,0:28:20.32,0:28:23.90,English,,0,0,0,, And then you have infinity positive infinity
Dialogue: 0,0:28:20.32,0:28:23.90,Chinese,,0,0,0,,然后你有正无穷大
Dialogue: 0,0:28:24.44,0:28:29.20,English,,0,0,0,,You have a similar similar situation on the for the negative numbers
Dialogue: 0,0:28:24.44,0:28:29.20,Chinese,,0,0,0,,对于负数,你有类似的类似情况
Dialogue: 0,0:28:30.36,0:28:34.48,English,,0,0,0,,And then negative and positive not a numbers
Dialogue: 0,0:28:30.36,0:28:34.48,Chinese,,0,0,0,,然后就分别是正数和负数情况下的非数字(NaN)
Dialogue: 0,0:28:39.58,0:28:43.28,English,,0,0,0,,So I think the you know you've probably discovered
Dialogue: 0,0:28:39.58,0:28:43.28,Chinese,,0,0,0,,所以我想你知道你可能已经发现了
Dialogue: 0,0:28:43.50,0:28:50.38,English,,0,0,0,,The really good way to try to understand these numeric and Coatings is just to do examples with only a few number of bits
Dialogue: 0,0:28:43.50,0:28:50.38,Chinese,,0,0,0,,举一个仅包含几位的例子是尝试理解这些数字和规则的有效方法
Dialogue: 0,0:28:50.86,0:28:54.02,English,,0,0,0,,You know if you want to understand like for example in two's complement
Dialogue: 0,0:28:50.86,0:28:54.02,Chinese,,0,0,0,,你知道如果你想要理解,比如二进制补码
Dialogue: 0,0:28:54.60,0:28:59.20,English,,0,0,0,,If you want to understand Tmin and Tmax and how they relate to each other
Dialogue: 0,0:28:54.60,0:28:59.20,Chinese,,0,0,0,,如果你想了解 Tmin 和 Tmax 以及它们之间的相互关系
Dialogue: 0,0:28:59.56,0:29:03.88,English,,0,0,0,,Just do a three bit two's complement system
Dialogue: 0,0:28:59.56,0:29:03.88,Chinese,,0,0,0,,只做三位二进制补码系统
Dialogue: 0,0:29:03.88,0:29:07.08,English,,0,0,0,,You know imagine just have a system with two's complement of three bits
Dialogue: 0,0:29:03.88,0:29:07.08,Chinese,,0,0,0,,你想象一下,系统有二进制三位补码
Dialogue: 0,0:29:07.68,0:29:11.68,English,,0,0,0,,And then you can just enumerate all those all the possibilities and you can see
Dialogue: 0,0:29:07.68,0:29:11.68,Chinese,,0,0,0,,然后你可以列举所有可能性,你可以看到
Dialogue: 0,0:29:12.38,0:29:17.96,English,,0,0,0,,And then you see where you know the Tmin is actually one greater than Tmax
Dialogue: 0,0:29:12.38,0:29:17.96,Chinese,,0,0,0,,然后你会看到你知道 Tmin 实际上比 Tmax 更大的地方
Dialogue: 0,0:29:17.96,0:29:22.58,English,,0,0,0,,You know so if you add one to Tmax it actually overflows into Tmin
Dialogue: 0,0:29:17.96,0:29:22.58,Chinese,,0,0,0,,你知道如果你在 Tmax 中添加 1,它实际上会溢出到 Tmin
Dialogue: 0,0:29:25.20,0:29:29.98,English,,0,0,0,,Similar thing for floating point it's...I would really encourage you to do this
Dialogue: 0,0:29:25.20,0:29:29.98,Chinese,,0,0,0,,浮点数也有类似的事情......我真的很鼓励你们这样做
Dialogue: 0,0:29:29.98,0:29:36.80,English,,0,0,0,,Just try some simple examples with a sort of tyent with a small number of exp and frack bits
Dialogue: 0,0:29:29.98,0:29:36.80,Chinese,,0,0,0,,只需尝试一些带有少量 exp 和 frac 位的简单示例
Dialogue: 0,0:29:37.32,0:29:43.48,English,,0,0,0,,So in this case we're going to look at a floating point system based on IEEE
Dialogue: 0,0:29:37.32,0:29:43.48,Chinese,,0,0,0,,所以在这种情况下,我们将看到一个基于 IEEE 的浮点系统
Dialogue: 0,0:29:43.50,0:29:47.58,English,,0,0,0,,That has 4 exp bits and three frack bits
Dialogue: 0,0:29:43.50,0:29:47.58,Chinese,,0,0,0,,它有 4 个 exp 位和 3 个 frac 位
Dialogue: 0,0:29:48.64,0:29:51.48,English,,0,0,0,,As always the sign bit is the most significant bit
Dialogue: 0,0:29:48.64,0:29:51.48,Chinese,,0,0,0,,一如既往,符号位是最重要的位
Dialogue: 0,0:29:52.04,0:29:54.20,English,,0,0,0,,Followed by exp followed by frac
Dialogue: 0,0:29:52.04,0:29:54.20,Chinese,,0,0,0,,其次是 exp,然后是 frac
Dialogue: 0,0:29:55.92,0:30:03.08,English,,0,0,0,,Okay so this is identical to IEEE floating point except for the size of that exp in fractals
Dialogue: 0,0:29:55.92,0:30:03.08,Chinese,,0,0,0,,好的,除了exp,frac 的位数外,这与 IEEE 浮点相同
Dialogue: 0,0:30:04.42,0:30:10.72,English,,0,0,0,,So it's actually small enough that we can now just enumerate these values
Dialogue: 0,0:30:04.42,0:30:10.72,Chinese,,0,0,0,,所以它实际上足够小,小到我们可以枚举这些值
Dialogue: 0,0:30:11.56,0:30:22.96,English,,0,0,0,,And now you can, you can start to see why these weird definitions for the exponent in the denominator
Dialogue: 0,0:30:11.56,0:30:22.96,Chinese,,0,0,0,,现在你可以,你可以开始看到分母中指数的这些奇怪定义的原因
Dialogue: 0,0:30:23.84,0:30:27.02,English,,0,0,0,,So let's just look at...
Dialogue: 0,0:30:23.84,0:30:27.02,Chinese,,0,0,0,,那么我们来看......
Dialogue: 0,0:30:27.76,0:30:32.52,English,,0,0,0,,So we will stand here,we've just
Dialogue: 0,0:30:27.76,0:30:32.52,Chinese,,0,0,0,,我们只是
Dialogue: 0,0:30:33.46,0:30:40.92,English,,0,0,0,,All of 2^7 possibilities possible combinations of exp and frac fields starting with zero
Dialogue: 0,0:30:33.46,0:30:40.92,Chinese,,0,0,0,,列出从零开始所有 2^7 种可能的 exp 和 frac 字段的组合
Dialogue: 0,0:30:42.50,0:30:45.16,English,,0,0,0,,Okay so when exp is all zeros
Dialogue: 0,0:30:42.50,0:30:45.16,Chinese,,0,0,0,,好的,所以当 exp 全部为零时
Dialogue: 0,0:30:45.52,0:30:48.38,English,,0,0,0,,That's a denorm right by definition
Dialogue: 0,0:30:45.52,0:30:48.38,Chinese,,0,0,0,,根据定义,这是一种非规格化值
Dialogue: 0,0:30:49.72,0:30:59.34,English,,0,0,0,,And then we have the three frac bits are all zero
Dialogue: 0,0:30:49.72,0:30:59.34,Chinese,,0,0,0,,然后我们有三个小数字段位全零
Dialogue: 0,0:30:59.66,0:31:03.04,English,,0,0,0,,Okay so remember the exp is all zeros
Dialogue: 0,0:30:59.66,0:31:03.04,Chinese,,0,0,0,,好的,所以记住 exp 全是零
Dialogue: 0,0:31:03.44,0:31:13.20,English,,0,0,0,,Right so the for denorm the exponent value is 1- bias, bias here is 7
Dialogue: 0,0:31:03.44,0:31:13.20,Chinese,,0,0,0,,因此,对于非标准化数指数值是 1-bias,这里的 bias 是7(bias 即偏置值)
Dialogue: 0,0:31:14.12,0:31:18.71,English,,0,0,0,,Okay so 1-7 gives us a value for the exponent of -6
Dialogue: 0,0:31:14.12,0:31:18.71,Chinese,,0,0,0,,好的,1-7 得到指数值是 -6
Dialogue: 0,0:31:19.56,0:31:21.42,English,,0,0,0,,So we're going to take the frac
Dialogue: 0,0:31:19.56,0:31:21.42,Chinese,,0,0,0,,接着我们要取得小数字段
Dialogue: 0,0:31:23.20,0:31:28.70,English,,0,0,0,, The bits in the frac field times
Dialogue: 0,0:31:23.20,0:31:28.70,Chinese,,0,0,0,,frac 表示的值乘以 m
Dialogue: 0,0:31:30.02,0:31:31.24,English,,0,0,0,,So m is 0
Dialogue: 0,0:31:30.02,0:31:31.24,Chinese,,0,0,0,,m 是 0
Dialogue: 0,0:31:32.06,0:31:38.42,English,,0,0,0,,So m in this case is 0*2^-6 gives us 0
Dialogue: 0,0:31:32.06,0:31:38.42,Chinese,,0,0,0,,所以在这种情况下是 M 是 0,0*2^-6 得到 0
Dialogue: 0,0:31:38.76,0:31:42.12,English,,0,0,0,,So this is our representation of 0
Dialogue: 0,0:31:38.76,0:31:42.12,Chinese,,0,0,0,,所以这是我们 0 的表达方式
Dialogue: 0,0:31:42.12,0:31:44.72,English,,0,0,0,,And like I said it's really it's nice that it actually is
Dialogue: 0,0:31:42.12,0:31:44.72,Chinese,,0,0,0,,就像我说的那样,实际上真的很棒
Dialogue: 0,0:31:45.16,0:31:50.12,English,,0,0,0,,If we just treated this as an unsigned integer, it would be 0
Dialogue: 0,0:31:45.16,0:31:50.12,Chinese,,0,0,0,,如果我们只是将其视为无符号整数,那么它表示 0
Dialogue: 0,0:31:50.50,0:31:52.08,English,,0,0,0,,Okay so that's kind of pleasing
Dialogue: 0,0:31:50.50,0:31:52.08,Chinese,,0,0,0,,好的,这样很愉快
Dialogue: 0,0:31:53.20,0:31:54.94,English,,0,0,0,,Now let's look at the very next number right
Dialogue: 0,0:31:53.20,0:31:54.94,Chinese,,0,0,0,,现在让我们看看下一个数字吧
Dialogue: 0,0:31:54.96,0:32:00.10,English,,0,0,0,,The exp is still 0 and we've just bumped up frac by 1
Dialogue: 0,0:31:54.96,0:32:00.10,Chinese,,0,0,0,,exp 仍为 0,我们刚刚将 frac 加了 1
Dialogue: 0,0:32:01.40,0:32:06.74,English,,0,0,0,,Ok so again it's a 1-bias which is -6
Dialogue: 0,0:32:01.40,0:32:06.74,Chinese,,0,0,0,,好的,依然 E=1-bias,即 -6
Dialogue: 0,0:32:08.22,0:32:18.62,English,,0,0,0,,And now this,this frac field represents this is 1/2,1/4,1/8
Dialogue: 0,0:32:08.22,0:32:18.62,Chinese,,0,0,0,,现在这个,这个 frac 域各位依次表示 1/2, 1/4, 1/ 8
Dialogue: 0,0:32:19.12,0:32:23.62,English,,0,0,0,,So it represents,so this is a value of amaz it is 1/8
Dialogue: 0,0:32:19.12,0:32:23.62,Chinese,,0,0,0,,所以是 1/8
Dialogue: 0,0:32:24.72,0:32:31.08,English,,0,0,0,, So 1/8*2^-6(1/64)=1/512
Dialogue: 0,0:32:24.72,0:32:31.08,Chinese,,0,0,0,,所以 1/8*2^-6(1/64)= 1/512
Dialogue: 0,0:32:31.46,0:32:34.14,English,,0,0,0,,So in this floating point system the smallest nonzero number
Dialogue: 0,0:32:31.46,0:32:34.14,Chinese,,0,0,0,,这个数是这个浮点数系统中最小的非零数
Dialogue: 0,0:32:34.14,0:32:38.58,English,,0,0,0,,We can represent is the denormalized representation of 1/512
Dialogue: 0,0:32:34.14,0:32:38.58,Chinese,,0,0,0,,我们只能用非规格化表示 1/512
Dialogue: 0,0:32:39.42,0:32:41.12,English,,0,0,0,, The next smallest number is 0
Dialogue: 0,0:32:39.42,0:32:41.12,Chinese,,0,0,0,,下一个最小的数字是 0
Dialogue: 0,0:32:44.74,0:32:49.24,English,,0,0,0,,Okay now let's look at, so let's take, let's bump this up by one
Dialogue: 0,0:32:44.74,0:32:49.24,Chinese,,0,0,0,,好的,现在让我们来看看,让我们把它再增大 1
Dialogue: 0,0:32:49.24,0:32:54.16,English,,0,0,0,, So now we get a frac field of 010
Dialogue: 0,0:32:49.24,0:32:54.16,Chinese,,0,0,0,,所以现在小数字段区域是 010
Dialogue: 0,0:32:54.16,0:32:57.88,English,,0,0,0,,So this represents 1/4
Dialogue: 0,0:32:54.16,0:32:57.88,Chinese,,0,0,0,,所以这代表 1/4
Dialogue: 0,0:32:59.46,0:33:05.12,English,,0,0,0,,So m is 1/4 that significant is 1/4*2^-6
Dialogue: 0,0:32:59.46,0:33:05.12,Chinese,,0,0,0,,所以 m 是 1/4,明显(结果)是 1/4*2^-6
Dialogue: 0,0:33:05.26,0:33:10.06,English,,0,0,0,,So 2/8*1/64 is 2/512
Dialogue: 0,0:33:05.26,0:33:10.06,Chinese,,0,0,0,,所以 2/8*1/64 是 2/512
Dialogue: 0,0:33:11.08,0:33:19.74,English,,0,0,0,,Okay so the the numbers were just it by incrementing this by incrementing are significant
Dialogue: 0,0:33:11.08,0:33:19.74,Chinese,,0,0,0,,这些数字通过递增 frac(尾数)来不断递增是有意义的
Dialogue: 0,0:33:20.12,0:33:23.78,English,,0,0,0,,We're increasing the numbers by 1/512
Dialogue: 0,0:33:20.12,0:33:23.78,Chinese,,0,0,0,,我们将这个数字增加了 1/512
Dialogue: 0,0:33:26.32,0:33:33.34,English,,0,0,0,,Now the largest denorm in this number system is the case where the frac field is all ones
Dialogue: 0,0:33:26.32,0:33:33.34,Chinese,,0,0,0,,现在,这个数字系统中最大的变形就是 frac 是全 1
Dialogue: 0,0:33:34.48,0:33:44.68,English,,0,0,0,,And so this encodes 1/2+1/4+1/8 which is 7/8
Dialogue: 0,0:33:34.48,0:33:44.68,Chinese,,0,0,0,,所以这编码为1/2 + 1/4 + 1/8,即7/8
Dialogue: 0,0:33:44.68,0:33:52.90,English,,0,0,0,,And then our value is 7/8*2^-6(1/64) =7/512
Dialogue: 0,0:33:44.68,0:33:52.90,Chinese,,0,0,0,,然后我们的值是 7/8*2^-6(1/64)= 7/512
Dialogue: 0,0:33:54.94,0:34:01.10,English,,0,0,0,,So this 7/512 is the largest denormalized number we can represent in this system
Dialogue: 0,0:33:54.94,0:34:01.10,Chinese,,0,0,0,,所以这个 7/512 是我们在这个系统中可以表示的最大的非规格化的值
Dialogue: 0,0:34:02.50,0:34:09.70,English,,0,0,0,,And now if we bump our number up by one the the frac field resets to zero
Dialogue: 0,0:34:02.50,0:34:09.70,Chinese,,0,0,0,,现在如果我们将数字增加 1,则 frac 重置为零
Dialogue: 0,0:34:09.72,0:34:13.48,English,,0,0,0,,And now the exp field goes from 0 to 1
Dialogue: 0,0:34:09.72,0:34:13.48,Chinese,,0,0,0,,现在 exp 域从 0 变为 1
Dialogue: 0,0:34:17.02,0:34:19.86,English,,0,0,0,,Now because the exp field is nonzero
Dialogue: 0,0:34:17.02,0:34:19.86,Chinese,,0,0,0,,现在因为 exp 域非全零
Dialogue: 0,0:34:19.86,0:34:23.38,English,,0,0,0,,This is no longer a denormalized number,It's a normalized number
Dialogue: 0,0:34:19.86,0:34:23.38,Chinese,,0,0,0,,这不再是非规格化的值,而是一个规格化数字
Dialogue: 0,0:34:25.06,0:34:33.44,English,,0,0,0,,Okay so now we're changing the definition of E from 1-bias to exp - bias
Dialogue: 0,0:34:25.06,0:34:33.44,Chinese,,0,0,0,,好的,现在我们将 E 的定义从 1-bias 改为 Exp-bias
Dialogue: 0,0:34:35.34,0:34:38.08,English,,0,0,0,,So what's exp in this case ?
Dialogue: 0,0:34:35.34,0:34:38.08,Chinese,,0,0,0,,那么在这种情况下指数字段 exp 是什么?
Dialogue: 0,0:34:40.50,0:34:46.50,English,,0,0,0,,1-7,the bias is -6
Dialogue: 0,0:34:40.50,0:34:46.50,Chinese,,0,0,0,,1-7,偏置为 -6
Dialogue: 0,0:34:46.52,0:34:57.08,English,,0,0,0,, So lower in hold,it's the same exponent as the previous denormalized number
Dialogue: 0,0:34:46.52,0:34:57.08,Chinese,,0,0,0,,因此指数保持不变,它与先前非标规格化的值的指数相同
Dialogue: 0,0:34:57.50,0:35:00.72,English,,0,0,0,,So this is actually very clever by the IEEE folks
Dialogue: 0,0:34:57.50,0:35:00.72,Chinese,,0,0,0,,所以说 IEEE 的家伙们实际上非常聪明
Dialogue: 0,0:35:01.10,0:35:06.54,English,,0,0,0,,Because you get the spirit,you get this nice smooth transition from denorm to normalize
Dialogue: 0,0:35:01.10,0:35:06.54,Chinese,,0,0,0,,因为你领略了其中的精髓,你会明白从非规格化数到规格化数的平滑过渡
Dialogue: 0,0:35:07.44,0:35:13.30,English,,0,0,0,,So you can see that our exponent E is -6 still
Dialogue: 0,0:35:07.44,0:35:13.30,Chinese,,0,0,0,,所以你可以看到我们的指数 E 仍为 -6
Dialogue: 0,0:35:15.08,0:35:29.54,English,,0,0,0,,And now,because we're taking 1-bias(7) And are significant now remember this is a normalized number
Dialogue: 0,0:35:15.08,0:35:29.54,Chinese,,0,0,0,,现在,因为我们正在使用 1-bias(7),记住这是一个规格化的数字
Dialogue: 0,0:35:29.54,0:35:32.92,English,,0,0,0,,Because the exp field is nonzero
Dialogue: 0,0:35:29.54,0:35:32.92,Chinese,,0,0,0,,因为 exp 域非全零
Dialogue: 0,0:35:35.74,0:35:41.26,English,,0,0,0,,They are a frac field of all zeros represents a significant of 1.000
Dialogue: 0,0:35:35.74,0:35:41.26,Chinese,,0,0,0,,值得注意的是,小数字段全 0 代表 1.000
Dialogue: 0,0:35:43.00,0:35:47.96,English,,0,0,0,,Okay so this normalized number this the smallest normalized number
Dialogue: 0,0:35:43.00,0:35:47.96,Chinese,,0,0,0,,好的,这个标准化的数字是最小的标准化数字
Dialogue: 0,0:35:49.06,0:35:59.70,English,,0,0,0,,Represents is 1.000 which is 8/8*2^-6(1/64) which gives us 8/512
Dialogue: 0,0:35:49.06,0:35:59.70,Chinese,,0,0,0,,代表是 1.000,这是 8/8*2^-6(1/64),它给我们 8/512
Dialogue: 0,0:35:59.80,0:36:05.72,English,,0,0,0,,So we've made this nice smooth transition from 7/512 to 8/512
Dialogue: 0,0:35:59.80,0:36:05.72,Chinese,,0,0,0,,所以我们已经实现了从 7/512 到 8/512 的平滑过渡
Dialogue: 0,0:36:07.28,0:36:08.82,English,,0,0,0,,And how do one more
Dialogue: 0,0:36:07.28,0:36:08.82,Chinese,,0,0,0,,又如何做一个
Dialogue: 0,0:36:08.82,0:36:09.90,English,,0,0,0,, I don't want to
Dialogue: 0,0:36:08.82,0:36:09.90,Chinese,,0,0,0,,我不想
Dialogue: 0,0:36:10.60,0:36:15.46,English,,0,0,0,,So if we bump keeping the exp field 1
Dialogue: 0,0:36:10.60,0:36:15.46,Chinese,,0,0,0,,因此,如果我们保持 exp 字段 1
Dialogue: 0,0:36:15.46,0:36:17.94,English,,0,0,0,,If we bump our frac field from 0 to 1
Dialogue: 0,0:36:15.46,0:36:17.94,Chinese,,0,0,0,,如果我们将我们的 frac 从 0 增加到 1
Dialogue: 0,0:36:18.86,0:36:31.12,English,,0,0,0,,Now this represents the the significant of 1.0, 1.001
Dialogue: 0,0:36:18.86,0:36:31.12,Chinese,,0,0,0,,现在这代表了 1.001 的重要性
Dialogue: 0,0:36:32.92,0:36:36.66,English,,0,0,0,,Which is 8/8+1/8
Dialogue: 0,0:36:32.92,0:36:36.66,Chinese,,0,0,0,,这是 8/8+1/8
Dialogue: 0,0:36:38.48,0:36:48.10,English,,0,0,0,,So that's 9/8 times...and then the value is 9/8*2^-6(1/64) which is equal to 9/512
Dialogue: 0,0:36:38.48,0:36:48.10,Chinese,,0,0,0,,最终值为 9/8*2^-6(1/64),等于 9/512
Dialogue: 0,0:36:48.54,0:36:52.07,English,,0,0,0,,Okay
Dialogue: 0,0:36:48.54,0:36:52.07,Chinese,,0,0,0,,好的
Dialogue: 0,0:36:52.44,0:36:53.68,English,,0,0,0,,Any questions about that?
Dialogue: 0,0:36:52.44,0:36:53.68,Chinese,,0,0,0,,对此有任何疑问?
Dialogue: 0,0:36:59.42,0:37:00.44,English,,0,0,0,,Question back here
Dialogue: 0,0:36:59.42,0:37:00.44,Chinese,,0,0,0,,回答这里
Dialogue: 0,0:37:00.74,0:37:04.68,English,,0,0,0,,[student speaking]
Dialogue: 0,0:37:00.74,0:37:04.68,Chinese,,0,0,0,,[学生说话]
Dialogue: 0,0:37:04.68,0:37:09.68,English,,0,0,0,,Okay the question is why do you choose the bias that to be 2^(k-1) - 1
Dialogue: 0,0:37:04.68,0:37:09.68,Chinese,,0,0,0,,好的问题是为什么你选择偏置为 2^(k-1)-1
Dialogue: 0,0:37:10.04,0:37:13.16,English,,0,0,0,,Well go back to my finger diagram here
Dialogue: 0,0:37:10.04,0:37:13.16,Chinese,,0,0,0,,那么回到我的手指图
Dialogue: 0,0:37:13.78,0:37:18.46,English,,0,0,0,, so this is the range of exp fields that you want to
Dialogue: 0,0:37:13.78,0:37:18.46,Chinese,,0,0,0,,所以这是你想要的 exp 域的范围
Dialogue: 0,0:37:18.82,0:37:22.14,English,,0,0,0,,This is the range of E that you want to represent with 0 in the middle
Dialogue: 0,0:37:18.82,0:37:22.14,Chinese,,0,0,0,,你希望 E 范围的中位数是 0
Dialogue: 0,0:37:23.54,0:37:26.96,English,,0,0,0,,Okay and so you want to bias
Dialogue: 0,0:37:23.54,0:37:26.96,Chinese,,0,0,0,,所以你想要偏置值
Dialogue: 0,0:37:26.96,0:37:32.62,English,,0,0,0,,So that this is halfway,the smallest exponent is halfway to 0
Dialogue: 0,0:37:26.96,0:37:32.62,Chinese,,0,0,0,,因此,这是中间,最小的指数是 0 的一半
Dialogue: 0,0:37:34.36,0:37:36.20,English,,0,0,0,,So you want the bias to shift it up
Dialogue: 0,0:37:34.36,0:37:36.20,Chinese,,0,0,0,,所以你希望偏置值能够改变它
Dialogue: 0,0:37:36.20,0:37:42.86,English,,0,0,0,,So it's the smallest value of exp corresponds to the smallest exponent
Dialogue: 0,0:37:36.20,0:37:42.86,Chinese,,0,0,0,,因此,exp 的最小值对应于最小的指数
Dialogue: 0,0:37:43.56,0:37:51.70,English,,0,0,0,,Right so 2^(k-1)-1 is just giving you a value that's halfway between the smallest exponent and the largest exponent
Dialogue: 0,0:37:43.56,0:37:51.70,Chinese,,0,0,0,,对,所以 2^(k-1)-1 只给你一个在最小指数和最大指数之间的值
Dialogue: 0,0:37:53.40,0:37:53.76,English,,0,0,0,,Okay
Dialogue: 0,0:37:53.40,0:37:53.76,Chinese,,0,0,0,,好的
Dialogue: 0,0:37:56.58,0:37:57.84,English,,0,0,0,,That's good.Any other questions?
Dialogue: 0,0:37:56.58,0:37:57.84,Chinese,,0,0,0,,那很好。还有其他问题吗?
Dialogue: 0,0:38:05.20,0:38:10.74,English,,0,0,0,,Okay if we take a little smaller six bit format same thing as we did before
Dialogue: 0,0:38:05.20,0:38:10.74,Chinese,,0,0,0,,好的,如果我们采用与之前相同的六位格式
Dialogue: 0,0:38:10.74,0:38:14.20,English,,0,0,0,,Just different numbers of bits in exp and frac
Dialogue: 0,0:38:10.74,0:38:14.20,Chinese,,0,0,0,,exp 和 frac 有不同的位数
Dialogue: 0,0:38:14.84,0:38:18.66,English,,0,0,0,,And then we plot these on the number line
Dialogue: 0,0:38:14.84,0:38:18.66,Chinese,,0,0,0,,然后我们在数轴上绘制这些图
Dialogue: 0,0:38:18.66,0:38:24.74,English,,0,0,0,,You can see that the values are very dense around zero
Dialogue: 0,0:38:18.66,0:38:24.74,Chinese,,0,0,0,,你可以看到值在零附近非常密集
Dialogue: 0,0:38:24.74,0:38:27.50,English,,0,0,0,,So they're very spaced very closely together
Dialogue: 0,0:38:24.74,0:38:27.50,Chinese,,0,0,0,,所以他们非常紧密地在一起
Dialogue: 0,0:38:28.12,0:38:33.32,English,,0,0,0,,And then every time you increase the exponent by one
Dialogue: 0,0:38:28.12,0:38:33.32,Chinese,,0,0,0,,然后每次将指数增加一
Dialogue: 0,0:38:33.94,0:38:40.38,English,,0,0,0,,The numbers are spaced twice as far apart as the previous
Dialogue: 0,0:38:33.94,0:38:40.38,Chinese,,0,0,0,,这些数字的距离是前一个的两倍
Dialogue: 0,0:38:40.38,0:38:45.18,English,,0,0,0,,The numbers that were represented by the previous exponent
Dialogue: 0,0:38:40.38,0:38:45.18,Chinese,,0,0,0,,由前一个指数表示的数字
Dialogue: 0,0:38:46.26,0:38:48.66,English,,0,0,0,, So you can see like in this little example
Dialogue: 0,0:38:46.26,0:38:48.66,Chinese,,0,0,0,,所以你可以在这个小例子中看到
Dialogue: 0,0:38:50.72,0:38:55.92,English,,0,0,0,,You see these...these values here are all equally spaced
Dialogue: 0,0:38:50.72,0:38:55.92,Chinese,,0,0,0,,你看到这些......这里的这些值都是等间距的
Dialogue: 0,0:38:56.82,0:39:00.38,English,,0,0,0,,These four values are equally spaced and they're right next to each other
Dialogue: 0,0:38:56.82,0:39:00.38,Chinese,,0,0,0,,这四个值间隔相等,它们彼此相邻
Dialogue: 0,0:39:01.06,0:39:07.48,English,,0,0,0,,And then you see this jump in the spacing that represents an increase in the exp field by one
Dialogue: 0,0:39:01.06,0:39:07.48,Chinese,,0,0,0,,你会看到这些值之间是有间隔的,表示 exp 域增加了 1
Dialogue: 0,0:39:09.52,0:39:14.02,English,,0,0,0,,And then that spacing doubles as we go out
Dialogue: 0,0:39:09.52,0:39:14.02,Chinese,,0,0,0,,然后,随着点向外扩展,间距加倍
Dialogue: 0,0:39:16.54,0:39:21.25,English,,0,0,0,,And you can see it even better here this if we zoom in
Dialogue: 0,0:39:16.54,0:39:21.25,Chinese,,0,0,0,,如果我们放大,你可以更清楚的看到它
Dialogue: 0,0:39:21.68,0:39:27.36,English,,0,0,0,,These blue values or denorms
Dialogue: 0,0:39:21.68,0:39:27.36,Chinese,,0,0,0,,这些蓝色值或非规格化值
Dialogue: 0,0:39:28.36,0:39:34.20,English,,0,0,0,,And then we have the the next set of normalized values where the frac field is 1
Dialogue: 0,0:39:28.36,0:39:34.20,Chinese,,0,0,0,,然后我们得到下一组规格化值,其中 frac 为 1
Dialogue: 0,0:39:34.20,0:39:39.32,English,,0,0,0,,They're spaced the same right we saw this when we kept increasing by 1/512
Dialogue: 0,0:39:34.20,0:39:39.32,Chinese,,0,0,0,,当我们不停的增加 1/512 时,它们与我们看到的相同
Dialogue: 0,0:39:41.42,0:39:45.36,English,,0,0,0,,And then we increase the the exponent by one and the spacing doubles
Dialogue: 0,0:39:41.42,0:39:45.36,Chinese,,0,0,0,,然后我们将指数增加 1,间距增加一倍
Dialogue: 0,0:39:51.46,0:39:55.46,English,,0,0,0,,Okay so this like I mentioned this encoding has some pretty nice properties
Dialogue: 0,0:39:51.46,0:39:55.46,Chinese,,0,0,0,,好的,所以这就像我提到的这个编码有一些非常好的属性
Dialogue: 0,0:39:55.82,0:40:02.66,English,,0,0,0,,The floating point zero is encoded as integer zero which is nice
Dialogue: 0,0:39:55.82,0:40:02.66,Chinese,,0,0,0,,浮点零被编码为整数零
Dialogue: 0,0:40:04.50,0:40:14.48,English,,0,0,0,,And with the exception of not a number,with the exception of not a number
Dialogue: 0,0:40:04.50,0:40:14.48,Chinese,,0,0,0,,除了非数字之外
Dialogue: 0,0:40:14.78,0:40:16.98,English,,0,0,0,,You can compare any floating-point numbers
Dialogue: 0,0:40:14.78,0:40:16.98,Chinese,,0,0,0,,你可以比较任何浮点数
Dialogue: 0,0:40:17.28,0:40:22.60,English,,0,0,0,,Including infinity by just treating it as doing an unsigned comparison
Dialogue: 0,0:40:17.28,0:40:22.60,Chinese,,0,0,0,,通过将其视为无符号比较来包括无穷大
Dialogue: 0,0:40:23.16,0:40:24.78,English,,0,0,0,,So that's really nice too
Dialogue: 0,0:40:23.16,0:40:24.78,Chinese,,0,0,0,,所以这也很好
Dialogue: 0,0:40:30.90,0:40:35.42,English,,0,0,0,,Um now if you, when you add and multiply floating point numbers
Dialogue: 0,0:40:30.90,0:40:35.42,Chinese,,0,0,0,,嗯,当你对浮点数进行相加或相乘操作时
Dialogue: 0,0:40:35.42,0:40:38.22,English,,0,0,0,,Right we're dealing with a limited set of bits here
Dialogue: 0,0:40:35.42,0:40:38.22,Chinese,,0,0,0,,对,我们在这里处理一组有限的位
Dialogue: 0,0:40:39.14,0:40:44.12,English,,0,0,0,,So if we take two numbers encoded as floating-point
Dialogue: 0,0:40:39.14,0:40:44.12,Chinese,,0,0,0,,所以如果我们把两个数字编码为浮点数
Dialogue: 0,0:40:44.12,0:40:48.26,English,,0,0,0,,And we add them together there's no guarantee that we'll be able to fit all those bits
Dialogue: 0,0:40:44.12,0:40:48.26,Chinese,,0,0,0,,两个数加在一起并不能保证结果能用这些有限位表示
Dialogue: 0,0:40:48.80,0:40:52.64,English,,0,0,0,,In the bits we have available to us
Dialogue: 0,0:40:48.80,0:40:52.64,Chinese,,0,0,0,,我们有限的位
Dialogue: 0,0:40:52.64,0:40:55.74,English,,0,0,0,,There's no guarantee that we'll be able to fit the the bits and the result
Dialogue: 0,0:40:52.64,0:40:55.74,Chinese,,0,0,0,,不能保证结果能用这些有限位表示
Dialogue: 0,0:40:56.64,0:40:59.84,English,,0,0,0,,So what we do in this case is
Dialogue: 0,0:40:56.64,0:40:59.84,Chinese,,0,0,0,,所以我们在这种情况下做的是
Dialogue: 0,0:41:00.14,0:41:06.58,English,,0,0,0,,You can imagine the model you want to have a floating-point operations addition to multiplication
Dialogue: 0,0:41:00.14,0:41:06.58,Chinese,,0,0,0,,浮点数加法你可以类比成乘法
Dialogue: 0,0:41:06.58,0:41:12.42,English,,0,0,0,,It's that you add or multiply you do the addition or multiplication
Dialogue: 0,0:41:06.58,0:41:12.42,Chinese,,0,0,0,,你自己做加法或乘法
Dialogue: 0,0:41:12.78,0:41:14.34,English,,0,0,0,,And you compute the exact result
Dialogue: 0,0:41:12.78,0:41:14.34,Chinese,,0,0,0,,然后你计算出确切的结果
Dialogue: 0,0:41:14.34,0:41:18.12,English,,0,0,0,, You just assume that you have an infinite amount of number of bits
Dialogue: 0,0:41:14.34,0:41:18.12,Chinese,,0,0,0,,你只是假设你拥有无限数量的位数
Dialogue: 0,0:41:19.02,0:41:25.24,English,,0,0,0,,And then you round use the technique called rounding to get it to fit into the of the available bits
Dialogue: 0,0:41:19.02,0:41:25.24,Chinese,,0,0,0,,然后你使用称为舍入的技术使有限的位数能够表示
Dialogue: 0,0:41:25.64,0:41:27.48,English,,0,0,0,,So the the effect
Dialogue: 0,0:41:25.64,0:41:27.48,Chinese,,0,0,0,,所以效果是
Dialogue: 0,0:41:28.20,0:41:35.22,English,,0,0,0,,Is like you doing say x + y is getting the precise value of x + y at an infinite number of bits
Dialogue: 0,0:41:28.20,0:41:35.22,Chinese,,0,0,0,,就像你说的那样,x + y 在无穷多的位数上得到 x + y 的精确值
Dialogue: 0,0:41:35.22,0:41:38.60,English,,0,0,0,,And then rounding into the available bits
Dialogue: 0,0:41:35.22,0:41:38.60,Chinese,,0,0,0,,然后四舍五入到可用位
Dialogue: 0,0:41:39.74,0:41:42.54,English,,0,0,0,,So let's look at this idea of rounding
Dialogue: 0,0:41:39.74,0:41:42.54,Chinese,,0,0,0,,那么让我们来看看这种舍入的想法
Dialogue: 0,0:41:42.54,0:41:47.46,English,,0,0,0,,This can be confusing the first you see it requires
Dialogue: 0,0:41:42.54,0:41:47.46,Chinese,,0,0,0,,一开始你可能会感到困惑
Dialogue: 0,0:41:48.02,0:41:52.62,English,,0,0,0,,You need to think about it carefully to get it right
Dialogue: 0,0:41:48.02,0:41:52.62,Chinese,,0,0,0,,你需要认真思考才能想明白
Dialogue: 0,0:41:52.76,0:41:55.54,English,,0,0,0,, Now in IEEE there's four different kinds of rounding
Dialogue: 0,0:41:52.76,0:41:55.54,Chinese,,0,0,0,,现在在 IEEE 中有四种不同的舍入方式
Dialogue: 0,0:41:55.54,0:42:05.88,English,,0,0,0,,There's round towards zero, round down route or round to minus infinity, Round up to which is rounding it to positive infinity
Dialogue: 0,0:41:55.54,0:42:05.88,Chinese,,0,0,0,,有向零舍入,向下舍入,向上舍入
Dialogue: 0,0:42:06.34,0:42:07.58,English,,0,0,0,, And then the default case
Dialogue: 0,0:42:06.34,0:42:07.58,Chinese,,0,0,0,,然后是默认情况
Dialogue: 0,0:42:07.58,0:42:09.94,English,,0,0,0,,Which is the only one route we're really going to consider
Dialogue: 0,0:42:07.58,0:42:09.94,Chinese,,0,0,0,,这是我们唯一一种需要去思考的方式
Dialogue: 0,0:42:10.24,0:42:12.92,English,,0,0,0,,Which is round to the nearest even
Dialogue: 0,0:42:10.24,0:42:12.92,Chinese,,0,0,0,,也就是向偶数舍入
Dialogue: 0,0:42:14.30,0:42:17.12,English,,0,0,0,,And this is what IEEE does by default
Dialogue: 0,0:42:14.30,0:42:17.12,Chinese,,0,0,0,,这就是 IEEE 制定的默认舍入规则
Dialogue: 0,0:42:17.98,0:42:18.84,English,,0,0,0,,You can,you can...
Dialogue: 0,0:42:17.98,0:42:18.84,Chinese,,0,0,0,,你可以,你可以......
Dialogue: 0,0:42:19.22,0:42:22.14,English,,0,0,0,,If you go into assembly language you can change the rounding
Dialogue: 0,0:42:19.22,0:42:22.14,Chinese,,0,0,0,,如果使用汇编语言,则可以更改舍入
Dialogue: 0,0:42:22.24,0:42:25.26,English,,0,0,0,,But we're not going to consider it any more.Yes question
Dialogue: 0,0:42:22.24,0:42:25.26,Chinese,,0,0,0,,但我们不会再考虑它了。好的,请提问
Dialogue: 0,0:42:25.26,0:42:30.18,English,,0,0,0,,[student speaking]
Dialogue: 0,0:42:25.26,0:42:30.18,Chinese,,0,0,0,,[学生说话]
Dialogue: 0,0:42:30.18,0:42:33.54,English,,0,0,0,,I'm sorry
Dialogue: 0,0:42:30.18,0:42:33.54,Chinese,,0,0,0,,抱歉
Dialogue: 0,0:42:33.54,0:42:35.02,English,,0,0,0,,There is right because there's one
Dialogue: 0,0:42:33.54,0:42:35.02,Chinese,,0,0,0,,是的,因为有一个
Dialogue: 0,0:42:35.18,0:42:40.62,English,,0,0,0,,So the question is there a distinct negative infinity and a distinct positive infinity
Dialogue: 0,0:42:35.18,0:42:40.62,Chinese,,0,0,0,,所以问题是存在独特的负无穷大和独特的正无穷大
Dialogue: 0,0:42:40.92,0:42:47.42,English,,0,0,0,,And there is they have the exact same bit representation except the most significant bit for negative infinity is one
Dialogue: 0,0:42:40.92,0:42:47.42,Chinese,,0,0,0,,并且它们具有完全相同的位表示,除了负无穷大的符号位是 1
Dialogue: 0,0:42:48.30,0:42:50.30,English,,0,0,0,,And for positive infinity it's zero
Dialogue: 0,0:42:48.30,0:42:50.30,Chinese,,0,0,0,,对于正无穷大,它是零
Dialogue: 0,0:42:52.96,0:42:54.00,English,,0,0,0,, Yes question
Dialogue: 0,0:42:52.96,0:42:54.00,Chinese,,0,0,0,,请提问
Dialogue: 0,0:42:54.00,0:42:58.14,English,,0,0,0,,[student speaking]
Dialogue: 0,0:42:54.00,0:42:58.14,Chinese,,0,0,0,,[学生说话]
Dialogue: 0,0:42:58.16,0:42:59.08,English,,0,0,0,,Why is nearest even?
Dialogue: 0,0:42:58.16,0:42:59.08,Chinese,,0,0,0,,为什么距离最近?
Dialogue: 0,0:42:59.08,0:43:00.20,English,,0,0,0,,[student speaking]
Dialogue: 0,0:42:59.08,0:43:00.20,Chinese,,0,0,0,,[学生说话]
Dialogue: 0,0:43:00.20,0:43:02.04,English,,0,0,0,,Oh I'll show you,let me go over the others
Dialogue: 0,0:43:00.20,0:43:02.04,Chinese,,0,0,0,,哦,我会告诉你,让我们听听别人的问题
Dialogue: 0,0:43:02.22,0:43:04.12,English,,0,0,0,,The question was about nearest even.yes
Dialogue: 0,0:43:02.22,0:43:04.12,Chinese,,0,0,0,,问题是关于最近的偶数。请继续
Dialogue: 0,0:43:04.12,0:43:08.42,English,,0,0,0,,[student speaking]
Dialogue: 0,0:43:04.12,0:43:08.42,Chinese,,0,0,0,,[学生说话]
Dialogue: 0,0:43:08.42,0:43:10.48,English,,0,0,0,,Well that was the exception right
Dialogue: 0,0:43:08.42,0:43:10.48,Chinese,,0,0,0,,那是例外
Dialogue: 0,0:43:11.22,0:43:15.76,English,,0,0,0,,That's right so aside from infinity you can't do that comparison
Dialogue: 0,0:43:11.22,0:43:15.76,Chinese,,0,0,0,,这是正确的,除了无限大之外你不能做那种比较
Dialogue: 0,0:43:17.72,0:43:21.52,English,,0,0,0,, Positive infinity works right but not negative so you're right
Dialogue: 0,0:43:17.72,0:43:21.52,Chinese,,0,0,0,,正无穷有效,负无穷不可以,所以你是对的
Dialogue: 0,0:43:21.52,0:43:22.88,English,,0,0,0,,But good point
Dialogue: 0,0:43:21.52,0:43:22.88,Chinese,,0,0,0,,但这是个好问题
Dialogue: 0,0:43:24.02,0:43:29.08,English,,0,0,0,,Let's look at these rounding modes and i'll explain why the neuro steven works
Dialogue: 0,0:43:24.02,0:43:29.08,Chinese,,0,0,0,,让我们看看这些舍入模式,我将解释这些舍入模式的原理
Dialogue: 0,0:43:29.46,0:43:32.12,English,,0,0,0,,But let's look at so rounding towards zero what we're going to do
Dialogue: 0,0:43:29.46,0:43:32.12,Chinese,,0,0,0,,但是让我们看看向零舍入,我们要做些什么
Dialogue: 0,0:43:32.68,0:43:35.98,English,,0,0,0,,We'll use dollars,so we want to round to the nearest dollar
Dialogue: 0,0:43:32.68,0:43:35.98,Chinese,,0,0,0,,我们将使用美元举例,因此我们希望舍入到最接近的美元
Dialogue: 0,0:43:37.64,0:43:43.38,English,,0,0,0,,Towards zero just anything less than you just round towards zero
Dialogue: 0,0:43:37.64,0:43:43.38,Chinese,,0,0,0,,向零舍入,不到 1 你就舍去为 0
Dialogue: 0,0:43:43.38,0:43:45.14,English,,0,0,0,,So dollar forty would go to one
Dialogue: 0,0:43:43.38,0:43:45.14,Chinese,,0,0,0,,所以 1.4 美元会变成 1 美元
Dialogue: 0,0:43:45.42,0:43:47.22,English,,0,0,0,, A dollar sixty would go down to one
Dialogue: 0,0:43:45.42,0:43:47.22,Chinese,,0,0,0,,1.60 美元将舍为 1 美元
Dialogue: 0,0:43:47.52,0:43:48.86,English,,0,0,0,,A dollar fifty to one
Dialogue: 0,0:43:47.52,0:43:48.86,Chinese,,0,0,0,,1.50 美元舍为 1 美元
Dialogue: 0,0:43:49.30,0:43:50.70,English,,0,0,0,,Two fifty would go to two
Dialogue: 0,0:43:49.30,0:43:50.70,Chinese,,0,0,0,,2.50 美元会舍为 2 美元
Dialogue: 0,0:43:51.16,0:43:53.66,English,,0,0,0,,-1.50 you round towards zero
Dialogue: 0,0:43:51.16,0:43:53.66,Chinese,,0,0,0,,-1.50 你向零舍入
Dialogue: 0,0:43:53.68,0:43:56.27,English,,0,0,0,,So that would be negative one
Dialogue: 0,0:43:53.68,0:43:56.27,Chinese,,0,0,0,,所以这将是 -1 美元
Dialogue: 0,0:43:56.70,0:44:06.40,English,,0,0,0,,Round down or towards negative infinity It's similar the only difference is that for negative one point
Dialogue: 0,0:43:56.70,0:44:06.40,Chinese,,0,0,0,,向下舍入或朝向负无穷大舍入类似,唯一的区别是 -1.50
Dialogue: 0,0:44:07.04,0:44:12.47,English,,0,0,0,,-1.50 you drown towards negative infinity which would be -2
Dialogue: 0,0:44:07.04,0:44:12.47,Chinese,,0,0,0,,-1.50 你趋向负无穷大,即 -2
Dialogue: 0,0:44:12.84,0:44:18.56,English,,0,0,0,,Rounding up is symmetric to round down
Dialogue: 0,0:44:12.84,0:44:18.56,Chinese,,0,0,0,,向上舍入和向下舍入正好相反
Dialogue: 0,0:44:18.78,0:44:24.22,English,,0,0,0,, The interesting case is round to nearest even
Dialogue: 0,0:44:18.78,0:44:24.22,Chinese,,0,0,0,,有趣的情况是向偶数舍入
Dialogue: 0,0:44:25.24,0:44:29.58,English,,0,0,0,,Interesting because it's what IEEE floating point actually uses
Dialogue: 0,0:44:25.24,0:44:29.58,Chinese,,0,0,0,,因为它是 IEEE 浮点实际使用的舍入方式
Dialogue: 0,0:44:30.22,0:44:37.66,English,,0,0,0,,So the idea here if you have a value that's less than half then you round down
Dialogue: 0,0:44:30.22,0:44:37.66,Chinese,,0,0,0,,所以这里的想法是,如果你的值小于一半,那么你向下舍入
Dialogue: 0,0:44:37.94,0:44:43.61,English,,0,0,0,,If you have a value that's more than halfway between two dollar amounts you round up
Dialogue: 0,0:44:37.94,0:44:43.61,Chinese,,0,0,0,,如果你的值超过两美元的一半,那么你就会向上舍入
Dialogue: 0,0:44:44.38,0:44:50.60,English,,0,0,0,,The route that nearest even part comes when you have something that's exactly halfway
Dialogue: 0,0:44:44.38,0:44:50.60,Chinese,,0,0,0,,向偶数舍入可以区分正好在中间的部门
Dialogue: 0,0:44:51.50,0:44:54.28,English,,0,0,0,, Then what you do is you round towards the nearest even number
Dialogue: 0,0:44:51.50,0:44:54.28,Chinese,,0,0,0,,然后你要做的是你向最近的偶数舍入
Dialogue: 0,0:44:56.44,0:44:59.76,English,,0,0,0,, Okay so in this example a dollar forty
Dialogue: 0,0:44:56.44,0:44:59.76,Chinese,,0,0,0,,好的,在这个例子中 1.40 美元
Dialogue: 0,0:45:00.38,0:45:05.14,English,,0,0,0,,Because it's less than half rounds down to one dollar
Dialogue: 0,0:45:00.38,0:45:05.14,Chinese,,0,0,0,,因为它不到一半舍入到一美元
Dialogue: 0,0:45:05.44,0:45:08.74,English,,0,0,0,,A dollar sixty is greater than half so we round up to two dollars
Dialogue: 0,0:45:05.44,0:45:08.74,Chinese,,0,0,0,,1.60 美元大于一半,所以舍入为 2 美元
Dialogue: 0,0:45:10.16,0:45:16.24,English,,0,0,0,,A dollar fifty right in the middle we round up to the nearest even
Dialogue: 0,0:45:10.16,0:45:16.24,Chinese,,0,0,0,,1.50 美元我们四舍五入到最近的偶数
Dialogue: 0,0:45:16.50,0:45:18.48,English,,0,0,0,,Dollar amount which is two dollars
Dialogue: 0,0:45:16.50,0:45:18.48,Chinese,,0,0,0,,也就是舍入到两美元
Dialogue: 0,0:45:20.04,0:45:25.26,English,,0,0,0,, Two dollars and fifty cents we round down to the nearest even