Re: scaling coefficients for c
- From: "Tom St Denis" <tomstdenis@xxxxxxxxx>
- Date: 21 Sep 2006 07:27:22 -0700
sonos wrote:
Hi,
I understand the requirement of scaling coefficients for fixed point
microcontrollers. However, I cannot seem to get past a simple issue... How
do I code a fraction in binary form for use in c code or asm language?
for example, consider the fraction in base 10:
dec == 0.58642
and the same fraction in binary
bin == 0.1001011
and the same fraction in hex
0.961F9F01C
but how do I set a c variable in binary form for fractions?
Why would you? It'd only be in the source, so do a one time conversion
to decimal and be done with.
float myfirstfloat = 0.58642.
???
Am I missing something here?
Tom
.
- Follow-Ups:
- Re: scaling coefficients for c
- From: Joe Wright
- Re: scaling coefficients for c
- References:
- scaling coefficients for c
- From: sonos
- scaling coefficients for c
- Prev by Date: Re: Why pointers??
- Next by Date: Re: C to Java Class Files compiler (AMPC version 1.5.1 released)
- Previous by thread: scaling coefficients for c
- Next by thread: Re: scaling coefficients for c
- Index(es):
Relevant Pages
|