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/nanmax/znanmaxa.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/nanmax/znanmaxa.c')
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c new file mode 100644 index 00000000..6283bf16 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/nanmax/znanmaxa.c @@ -0,0 +1,57 @@ +/* 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 "nanmax.h" +#include "types.h" +#include "doubleComplex.h" +#include "abs.h" + +doubleComplex znanmaxa(doubleComplex* in, int size) +{ +doubleComplex high=0; int k=0; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + k= 1; + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( zabss(in[i]) > zabss(high)) + { + high= in[i]; + + } + + + } + + + } + + +if(k != 0) +return high; +else +return - 0.0/0.0; +} |