Week3 Lecture, continued

object code: zeros and onesを返すもの
前半の数学チックな話はbeyond my understanding...


最後にすこし Bitwise operators の話。Codeacademy でも触れていた様な。5つのoperatorsについて解説していた。

1. & Ampersand operator: true & trueなどtrue/false で考えると分かりやすい.
0&0: 0
0&1: 0
1&0: 0
1&1: 0
Ands together the left hand variable and right hand variable and gives me the final result.
Ampersand って綴るの初めて知った(ずーっと、and percent てリスニングしてた).

2. | Or operator
0|0: 0
0|1: 1
1|0: 1
1|1: 1
If I have one 1 in the formula, the result is going to be 1.

3. ^ Exclusive or operator: 左右の辺の値が異なる(=exclusive) と1(=true), 同じだと(=not exclusive) 0(=false).
0^0: 0
0^1: 1
1^0: 1
1^1: 0

4. ~ Tilda operator: 否定というか、0と1をフリップさせる意。
~0: 1
~1: 0
Tildaのみ、Variableは1つしか取らない。

5. << left shift operator (>> right shift operator )
1<<7: shift 1 to the left by 7= 10000000
文字通り、1を7つ左にシフトさせる(シフトした部分は0で置き換える).

  • 例え遠隔でも、分からない部分があってもおもしろさはDavid のレクチャーの方がうえ。
  • 昨年ってyesteryearていうのね、耳からウロコ。

腫瘍内科が予想以上に忙しくてscratchの続きには至らず。