/* -------------------------------------------------------- setround.c for MacOS 9. This program is compiled by MrC command on MPW. -------------------------------------------------------- */ #include "mex.h" #include void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { switch ((int) mxGetScalar(prhs[0])) { case 1 : fesetround(FE_UPWARD); break; case 0 : fesetround(FE_TONEAREST); break; case -1 : fesetround(FE_DOWNWARD); break; default : fesetround(FE_TONEAREST); break; } } /* setround */