CMP EMBEDDED.COM

Login | Register     Welcome Guest ESC Boston  esc india  Call for Abstracts
 

Listing 5: Multiplication and division on same granularity variables Listing 5: Multiplication and division on same granularity variables

void Test7_9_X(FIXED7_9 a, FIXED7_9 b)
{
FIXED7_9 temp;
printf("\nResults of multiply and divide on 7_9 variables.\n");
temp.full = MULT7_9(a,b);
printf("Multiply result is %d.%1.1d\n", temp.part.integer,
(temp.part.fraction*10+256)/512);
temp.full = DIV7_9(a,b);
printf("Divide result is %d.%1.1d\n", temp.part.integer,
(temp.part.fraction*10+256)/512);
}
Embedded.com Career Center
Ready to take that job and shove it?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS


 :