File: getcole.c.patch

package info (click to toggle)
python-fitsio 1.3.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,020 kB
  • sloc: python: 7,963; ansic: 3,962; makefile: 10
file content (40 lines) | stat: -rw-r--r-- 1,635 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/getcole.c
+++ b/getcole.c
@@ -1425,7 +1425,7 @@ int fffr4r4(float *input,         /* I - array of values to be converted     */
                     }
                   }
                   else            /* it's an underflow */
-                     output[ii] = 0;
+                     output[ii] = input[ii];
               }
               else
                 output[ii] = input[ii];
@@ -1450,7 +1450,7 @@ int fffr4r4(float *input,         /* I - array of values to be converted     */
                     }
                   }
                   else            /* it's an underflow */
-                     output[ii] = (float) zero;
+                     output[ii] = (float) (input[ii] * scale + zero);
               }
               else
                   output[ii] = (float) (input[ii] * scale + zero);
@@ -1549,8 +1549,8 @@ int fffr8r4(double *input,        /* I - array of values to be converted     */
                     else
                         nullarray[ii] = 1;
                   }
-                  else            /* it's an underflow */
-                     output[ii] = 0;
+                  else
+                    output[ii] = (float) input[ii];
               }
               else
               {
@@ -1596,7 +1596,7 @@ int fffr8r4(double *input,        /* I - array of values to be converted     */
                         output[ii] = FLT_MAX;
                      }
                      else
-                        output[ii] = (float) zero;
+                        output[ii] = (float) (input[ii] * scale + zero);
                    }
               }
               else