2020-11-06から1日間の記事一覧
Make: Private by Design, p.107 Finally, if an EMP or GMD event shuts down power to law enforcement, water and sewer systems, gas stations, grocery stores, and hospitals, the least of your concerns might be protecting personal electronics. …
ビットフィールドを使えばビット演算をしなくても任意のビットにアクセスできるのであった。 #include <iostream> using namespace std; int main(void) { struct each_part { uint32_t mantissa : 23; uint32_t exp_part : 8; uint32_t sign : 1; }; union float_inte</iostream>…
共用体を使えばもっと簡単に内部表現が確認できるのであった。 #include <iostream> using namespace std; int main(void) { union float_internal { float f; uint32_t i32; uint8_t i8[4]; }; float_internal a; a.f = -123.456; printf("0x%X\n", a.i32); printf("0</iostream>…