Tag Archives: Mathematics

Python: 10進数整数を2進数文字列に変換する関数

2進数文字列を10進数整数に変換する関数int()はありますが、 >>> int(’1011′, 2) 11 その逆の、10進数整数を2進数文字列に変換する関数が(Python2.5では)見当たらなかったので、書いてみま … Continue reading

Posted in Python | Tagged , , , , | Leave a comment

10進数を2進数に変換表示するC言語プログラム

ソースコード // filename: dtob.c // convert decimal to binary #include <stdio.h> const int BitSize = sizeof(in … Continue reading

Posted in C/C++ | Tagged , , | Leave a comment

二桁の掛け算を素早く暗算する方法

最近使い始めた、同じ二桁(1の位の和が10であるもの)の数の掛け算を素早く暗算する方法を紹介します。 例:75×75を暗算する 頭の中で、 7×(7+1)×100+5×5=5625 のように計算します。 これは、まず始め … Continue reading

Posted in Days | Tagged , | 2 Comments