#include <stdio.h>
#include <fenv.h>
#pragma STDC FENV_ACCESS ON

int main(void) {
	int i;
	for(i=3; i>0; i -= 0.5 )
		printf("%d\n", i);
// store the original rounding mode
const int originalRounding = fegetround( );
// establish the desired rounding mode
fesetround(FE_TOWARDZERO);
// do whatever you need to do ...
	for(i=3; i>0; i -= 0.5 )
		printf("%d\n", i);

// ... and restore the original mode afterwards
fesetround(originalRounding);	 
	return 0;
}