Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@790 cc03376c-175c-47c8-b038-4cd826a8556b
20 lines
401 B
C
20 lines
401 B
C
#include <stdio.h>
|
|
#define A 0.5
|
|
#define B 0.55
|
|
|
|
_Sat long _Fract sat_add3 (_Sat long _Fract a, _Sat long _Fract b)
|
|
{
|
|
return a + b;
|
|
}
|
|
|
|
long _Fract mul3 (long _Fract a, long _Fract b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
printf("hello %X + %X = %X\n", (_Sat long _Fract)A, (_Sat long _Fract)B, sat_add3(A, B));
|
|
printf("hello %X * %X = %X\n", (_Sat long _Fract)A, (_Sat long _Fract)B, mul3(A, B));
|
|
}
|