本書は『7. ユーザーの要望』の指示を行い、作成してもらった内容に必要な加筆を行ったものである。
以下は、C++で標本化周波数と秒数からサンプル数を算出するコードである。このコードが最適か確認してほしい。
なお、アルゴリズムが説明できれば良いと考えたため、以下のコードでは、標本化周波数などの値のセットは行っていない。
| { | |
| "Example Name":"arithmeticSample", | |
| "Example Comment":"各計算結果はBitSizeのビット数を上限とした固定ビット幅に基づく算出結果となります。", | |
| "Case 1 : 8 bit (Dual Full Digits)":{ | |
| "BitSize":8, | |
| "num1 max digits":8, | |
| "num2 max digits":8, | |
| "Number Of SubCases":2, | |
| "SubCase 1":{ | |
| "num1":{ |
| /* | |
| 以下にまとめた内容をベースにクラス実装化 | |
| https://gist.github.com/hirosof/2dad279fc120d476a7079506cfab2572 | |
| */ | |
| #pragma once | |
| #include <bitset> | |
| #include <cstdint> | |
| #include <optional> | |
| #include <algorithm> |
| /* | |
| 以下にまとめた内容をベースにクラス実装化 | |
| https://gist.github.com/hirosof/2dad279fc120d476a7079506cfab2572 | |
| */ | |
| #pragma once | |
| #include <bitset> | |
| #include <cstdint> | |
| #include <optional> | |
| #include <algorithm> |