C言語なら俺に聞け! Part 102
■ このスレッドは過去ログ倉庫に格納されています
0203質問です。
05/02/13 15:54:12the number decimal point as in the following data protocol:
First byte: number of unpacked BCD digits before the decimal point
Second byte: number of unpacked BCD digits after the decimal point
Third byte: unpacked BCD most significant digit
Fourth byte: unpacked BCD next-to-least significant digit
ETC:
Ninth byte: unpacked BCD most significant decimal digit
(N+1)th byte: unpacked BCD next-to-least siginificant decimal digit
ETC:
An unpacked BCD char(byte) digit contains 0000nnnn, where 0000<nnnn<1001
Here is an example for the protocol.
If the string is 894.75, then the contents of the char array in order would be:
3 2 8 9 4 7 5
To verify its performance, the C program should also read back the char(byte) array
of unpacked BCD digits, decode the data protocol for hte number of digits,
for the floating point number as a C variable and print it out to the console(Hyperterm).
■ このスレッドは過去ログ倉庫に格納されています