diff options
author | imushir | 2016-02-22 14:18:24 +0530 |
---|---|---|
committer | imushir | 2016-02-22 14:18:24 +0530 |
commit | 8893f7bbb03012a7189016d37afcedad80d569c9 (patch) | |
tree | 9d26e4b472535ddbf0d07630d5ae5ee3f01f2d5e /src/c/elementaryFunctions/linspace/dlinspaces.c~ | |
parent | fad04e78ac69db4ef74c1bd45154fc430c18cccc (diff) | |
download | Scilab2C_fossee_old-8893f7bbb03012a7189016d37afcedad80d569c9.tar.gz Scilab2C_fossee_old-8893f7bbb03012a7189016d37afcedad80d569c9.tar.bz2 Scilab2C_fossee_old-8893f7bbb03012a7189016d37afcedad80d569c9.zip |
added support of double for linspace
Diffstat (limited to 'src/c/elementaryFunctions/linspace/dlinspaces.c~')
-rw-r--r-- | src/c/elementaryFunctions/linspace/dlinspaces.c~ | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/linspace/dlinspaces.c~ b/src/c/elementaryFunctions/linspace/dlinspaces.c~ new file mode 100644 index 0000000..82b88e3 --- /dev/null +++ b/src/c/elementaryFunctions/linspace/dlinspaces.c~ @@ -0,0 +1,25 @@ +/* + Scilab2C FOSSEE IIT Bombay + */ + +#include "linspace.h" +void dlinspaces(double low_limit,double up_limit,double range_num,double *out) +{ + int j; + double temp = low_limit; + float step_iterate = (up_limit-low_limit)/(range_num-1); + out[0] = low_limit; //First value of output is equal to low_limit value + for(j=1; j<(double)range_num; j++) + { + out[j] = temp + step_iterate; + temp = out[j]; + if(j == (double)range_num-1 ) + { + out[j] = (double)up_limit; // Last value of output is equal to up_limit value + } + } + + + +} + |