Skip to content
Snippets Groups Projects
Select Git revision
  • 21fe97859835f6fb6df1b33ba41c546d2dacd091
  • master default
2 results

TOC_ko.html

Blame
  • testcodemul.c 1.15 KiB
    #include "fx_s17_14.h"
    #include <stdio.h>
    
    int main()
    {	
    	double a = 21.468, b = 17.297;
    
    	int mul1, mul2, mul3, mul4;
    	mul1 = fxMul_float(fromDouble(a), fromDouble(b));
    	mul2 = fxMul_precision(fromDouble(a), fromDouble(b));
    	mul3 = fxMul_fair(fromDouble(a), fromDouble(b));	
    	mul4 = fxMul_performance(fromDouble(a), fromDouble(b));
    
    	fprintf(stdout, "================================================================================================= \n");
    	fprintf(stdout, "value : %.15f	fxMul_float       : %.15f	diff : %.15f \n", 21.468 * 17.297, toDouble(mul1), (21.468 * 17.297) - toDouble(mul1));
    	fprintf(stdout, "value : %.15f	fxMul_precision   : %.15f	diff : %.15f \n", 21.468 * 17.297, toDouble(mul2), (21.468 * 17.297) - toDouble(mul2));
    	fprintf(stdout, "value : %.15f	fxMul_fair        : %.15f	diff : %.15f \n", 21.468 * 17.297, toDouble(mul3), (21.468 * 17.297) - toDouble(mul3));
    	fprintf(stdout, "value : %.15f	fxMul_performance : %.15f	diff : %.15f \n", 21.468 * 17.297, toDouble(mul4), (21.468 * 17.297) - toDouble(mul4));
    	fprintf(stdout, "================================================================================================= \n");
    	return 0;
    }