Files correlati : gfm.dll Ricompilazione Demo : [ ] Commento : Modifiche per la compilazione Linux git-svn-id: svn://10.65.10.50/trunk@11079 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			36 lines
		
	
	
		
			627 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			627 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
#include <stdio.h>
 | 
						|
#include "gm.h"
 | 
						|
void ErrorHandler(int,int);
 | 
						|
int main(void);
 | 
						|
 | 
						|
void ErrorHandler(code,ref)
 | 
						|
int code,ref;
 | 
						|
{
 | 
						|
	char	serr[15],sfun[32];
 | 
						|
	ErrorName(serr, code);
 | 
						|
	FunctionName(sfun, ref);
 | 
						|
	printf("%s error in function %s\n",serr,sfun);
 | 
						|
}
 | 
						|
 | 
						|
int main()
 | 
						|
{
 | 
						|
	DEC	da, *a=&da, db, *b=&db, dc, *c=&dc, *p;
 | 
						|
	
 | 
						|
	SetMathErrVector(ErrorHandler);
 | 
						|
 | 
						|
	ZeroDecimal(a);
 | 
						|
	ZeroDecimal(b);
 | 
						|
	ZeroDecimal(c);
 | 
						|
	
 | 
						|
	dprintf("First number:   ");
 | 
						|
	dscanf("%.2t",a);
 | 
						|
	dprintf("Second number:  ");
 | 
						|
	dscanf("%.2t",b);
 | 
						|
	p = DivideDecimalAndRound(c,a,b,2);
 | 
						|
	if (p)
 | 
						|
		dprintf("%t / %t = %t\n",a,b,c);
 | 
						|
	else
 | 
						|
		dprintf("Division failed.\n");
 | 
						|
	return 0;
 | 
						|
}
 |