changeset 1264:0e01db679216 octave-forge

This change improves MATLAB compatibility. Previously, the "toascii" function was called when the input was a string. However, this only worked correctly for values under 128. Values between 128 and 256 were mapped to the range below 128, destroying the information in the most significant bit. The new implementation preserves this information, but it takes two operations and is therefore slower.
author qspencer
date Wed, 04 Feb 2004 19:46:56 +0000
parents caf86769cb16
children 7d153a95defc
files main/general/double.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main/general/double.m	Wed Feb 04 19:25:11 2004 +0000
+++ b/main/general/double.m	Wed Feb 04 19:46:56 2004 +0000
@@ -26,7 +26,7 @@
 function d = double(in)
 
   if isstr(in)
-      d = toascii(in);
+      d = mod(in+0,256);
   else
       d = in;
   end