#include #include #include /* file e-mat.c */ int main(int argc, char* argv[]){ int ee; double mantissa; double parte_int; double parte_dec; double nd, nd2; if(argc < 2){ printf("Use the format mat.x \n"); exit (1); } nd = atof(argv[1]); printf("%f e' compreso tra %f e %f \n",nd,floor(nd),ceil(nd)); mantissa = frexp(nd, &ee); printf("%f = %f * 2^%d \n", nd, mantissa, ee); nd2 = ldexp(mantissa, ee); // double ldexp(double num, int exp ) printf("Per conferma, %f = %f * 2^%d \n", nd2, mantissa, ee); parte_dec = modf(nd,&parte_int); printf("%f = %f + %f \n", nd, parte_int, parte_dec); printf("Il cubo di %f e' %f \n",nd,pow(nd,3)); return 0;}