TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NEIL HELLER
from: KURT KUZBA
date: 1997-03-22 13:41:00
subject: BCD and `folding`

NH>   Just thinking about it some more, it seems that a BCD
NH>   class would be in order.  How could I go about
NH>   investigating the existance of same?
NH>   Would anyone care to speculate on the comparitive
NH>   difficulties of doing this in C as opposed to C++?
nh>....
   It should be easy in C or C++, using bitfields.
class binary_coded_decimals{
private:
   int
   hundred_billions   :4,
   ten_billions       :4,
   billions           :4,
   hundred_millions   :4,
   ten_millions       :4,
   millions           :4,
   hundred_thousands  :4,
   ten_thousands      :4,
   thousands          :4,
   hundreds           :4,
   tens               :4,
   ones               :4;
};
typedef struct{
   int
   hundred_billions   :4,
   ten_billions       :4,
   billions           :4,
   hundred_millions   :4,
   ten_millions       :4,
   millions           :4,
   hundred_thousands  :4,
   ten_thousands      :4,
   thousands          :4,
   hundreds           :4,
   tens               :4,
   ones               :4;
} binary_coded_decimals;
The code to manage them I will leave up to the imagination. :)
It would be basically the same in either case.
> ] Let's try randomly accessing YOUR memory once...............
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.