Mercurial > hg > octave-lyh
diff liboctave/data-conv.cc @ 7991:139f47cf17ab
Change NA value to support single to double precision conversion
author | David Bateman <dbateman@free.fr> |
---|---|
date | Thu, 05 Jun 2008 21:58:14 +0200 |
parents | 82be108cc558 |
children | 25bc2d31e1bf |
line wrap: on
line diff
--- a/liboctave/data-conv.cc +++ b/liboctave/data-conv.cc @@ -34,6 +34,7 @@ #include "byte-swap.h" #include "data-conv.h" #include "lo-error.h" +#include "lo-ieee.h" template void swap_bytes<2> (volatile void *, int); template void swap_bytes<4> (volatile void *, int); @@ -1048,8 +1049,13 @@ break; case LS_DOUBLE: // No conversion necessary. - is.read (reinterpret_cast<char *> (data), 8 * len); - do_double_format_conversion (data, len, fmt); + { + is.read (reinterpret_cast<char *> (data), 8 * len); + do_double_format_conversion (data, len, fmt); + + for (int i = 0; i < len; i++) + data[i] = __lo_ieee_replace_old_NA (data[i]); + } break; default: