diff options
author | Brijeshcr | 2017-07-21 17:27:46 +0530 |
---|---|---|
committer | Brijeshcr | 2017-07-21 17:27:46 +0530 |
commit | 965e05dc348f796d2741ac7f410bcaff2a3fef56 (patch) | |
tree | 2509490fc61d6ddfffbc65d219f950a0c86044fa /2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c | |
parent | f931b48e9247c79748586399d970300127d8bdda (diff) | |
parent | bcbe9d1aae596e2a3e1669d0308bfa9003365972 (diff) | |
download | Scilab2C-965e05dc348f796d2741ac7f410bcaff2a3fef56.tar.gz Scilab2C-965e05dc348f796d2741ac7f410bcaff2a3fef56.tar.bz2 Scilab2C-965e05dc348f796d2741ac7f410bcaff2a3fef56.zip |
Median modified
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c')
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c b/2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c new file mode 100644 index 00000000..61441777 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/pmodulo/dpmodulos.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "pmodulo.h" +#include "types.h" + +double dpmodulos(double inp1, double inp2) +{ + if( inp1>0 && inp2>0) + + { + return fmod(inp1,inp2); + + } + + + if( inp1>0 && inp2<0) + + { + + return fmod(inp1,inp2); + + } + + + if(inp1<0 && inp2>0) + + { + + return ((fmod(inp1,inp2))+(inp2)); + + + } + + if(inp1<0 && inp2<0) + { + + return ((fmod(inp1,inp2))-(inp2)); + + } + +} |