summaryrefslogtreecommitdiff
path: root/macros/CFiles/sci2ccode/ConvertPrecision.c
diff options
context:
space:
mode:
authorSandeep Gupta2017-06-18 23:55:40 +0530
committerSandeep Gupta2017-06-18 23:55:40 +0530
commit277d1edfa17bf3719d90ddbac8e31f6181e952c3 (patch)
tree0661f1f52af0a0fd654edd4984c30e57037303c6 /macros/CFiles/sci2ccode/ConvertPrecision.c
downloadScilab2C_fossee_old-277d1edfa17bf3719d90ddbac8e31f6181e952c3.tar.gz
Scilab2C_fossee_old-277d1edfa17bf3719d90ddbac8e31f6181e952c3.tar.bz2
Scilab2C_fossee_old-277d1edfa17bf3719d90ddbac8e31f6181e952c3.zip
First commit
Diffstat (limited to 'macros/CFiles/sci2ccode/ConvertPrecision.c')
-rw-r--r--macros/CFiles/sci2ccode/ConvertPrecision.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/macros/CFiles/sci2ccode/ConvertPrecision.c b/macros/CFiles/sci2ccode/ConvertPrecision.c
new file mode 100644
index 0000000..ee3ecc3
--- /dev/null
+++ b/macros/CFiles/sci2ccode/ConvertPrecision.c
@@ -0,0 +1,41 @@
+/*
+** -*- C -*-
+**
+** ConvertPrecision.c
+** Made by Raffaele Nutricato <raffaele.nutricato@tiscali.it>
+**
+** Copyright Raffaele Nutricato 2008
+*/
+
+
+double s0doubled0(float in)
+{
+ double out;
+ out = (double) in;
+ return (out);
+}
+
+void s2doubled2(float* in, int* inSize, double* out)
+{
+ int i;
+ for (i=0; i<inSize[0]*inSize[1]; i++)
+ {
+ out[i] = (double) in[i];
+ }
+}
+
+float d0floats0(double in)
+{
+ float out;
+ out = (float) in;
+ return (out);
+}
+
+void d2floats2(double* in, int* inSize, float* out)
+{
+ int i;
+ for (i=0; i<inSize[0]*inSize[1]; i++)
+ {
+ out[i] = (float) in[i];
+ }
+}