Changeset 35101 for trunk/Ohana/src/libfits/table/F_get_column.c
- Timestamp:
- Feb 6, 2013, 3:20:55 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_get_column.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_get_column.c
r33648 r35101 96 96 } 97 97 if (!strcmp (type, "int64_t")) { 98 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 99 # ifdef BYTE_SWAP 100 SWAP_DBLE; 101 # endif 102 *(int64_t *)Pout = *(int64_t *)Pin*Bscale + Bzero; 98 if ((Bzero == 0.0) && (Bscale == 1.0)) { 99 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 100 # ifdef BYTE_SWAP 101 SWAP_DBLE; 102 # endif 103 *(int64_t *)Pout = *(int64_t *)Pin; 104 } 105 } else { 106 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 107 # ifdef BYTE_SWAP 108 SWAP_DBLE; 109 # endif 110 *(int64_t *)Pout = *(int64_t *)Pin*Bscale + Bzero; 111 } 103 112 } 104 113 } … … 243 252 } 244 253 if (!strcmp (type, "int64_t")) { 245 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 246 # ifdef BYTE_SWAP 247 SWAP_DBLE; 248 # endif 249 *(int64_t *)Pout = *(int64_t *)Pin*Bscale + Bzero; 254 // XXX 64 bit int operations with Bzero & Bscale are inaccurate even with doubles 255 if ((Bzero == 0.0) && (Bscale == 1.0)) { 256 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 257 # ifdef BYTE_SWAP 258 SWAP_DBLE; 259 # endif 260 *(int64_t *)Pout = *(int64_t *)Pin; 261 } 262 } else { 263 for (i = 0; i < Nval*Ny; i++, Pin+=Nbytes, Pout+=Nbytes) { 264 # ifdef BYTE_SWAP 265 SWAP_DBLE; 266 # endif 267 *(int64_t *)Pout = *(int64_t *)Pin*Bscale + Bzero; 268 } 250 269 } 251 270 }
Note:
See TracChangeset
for help on using the changeset viewer.
