From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,509f8e43dc081fde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.stueberl.de!news.germany.com!news.nask.pl!news.nask.org.pl!uw.edu.pl!newsfeed.sunet.se!news01.sunet.se!news.umu.se!not-for-mail From: Colin Paul Gloster Newsgroups: comp.lang.ada Subject: Re: Simulation of fixed point in c WITH DIFFERENT BIT-WIDTH Date: Wed, 2 Nov 2005 10:57:34 +0000 (UTC) Organization: News UmU SE Message-ID: References: <1130690498.388857.225170@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: ryp76.ryp.umu.se X-Trace: hudsucker.umdac.umu.se 1130929054 9013 130.239.11.76 (2 Nov 2005 10:57:34 GMT) X-Complaints-To: newsmaster@umu.se NNTP-Posting-Date: Wed, 2 Nov 2005 10:57:34 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:6114 Date: 2005-11-02T10:57:34+00:00 List-Id: Mnamky posted to news:comp.lang.ada : "Hi all; Consider the following exaple y = x * b' where x is 12-bit wordlength and 11-bit fraction and b is 16-bit wordlength and 14-bit fraction simulation of this code is rather easy im Matlab but how could we do a full analysis of this code in C with a good precision?" I fail to see the relevance of this to Ada. In C, you could use ints and interpret some bits as an integer and some bits as a vulgar fraction, as in computer games books for 386s and 486s (before Pentiums which had faster floating point support than integer support) in the 1990s, such as "Building a 3D Engine in C++" and La Mothe; Ratcliff; et al., "Tricks of the Game Programming Gurus", SAMS Publishing. A worse way would be to use bitfields.