octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MSVC compiler support [patch 36]: abs of long


From: Michael Goffioul
Subject: MSVC compiler support [patch 36]: abs of long
Date: Tue, 17 Oct 2006 22:11:47 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Help the compiler to find the correct function for "abs"
Index: src/pr-output.cc
===================================================================
RCS file: /cvs/octave/src/pr-output.cc,v
retrieving revision 1.149
diff -p -c -r1.149 pr-output.cc
*** src/pr-output.cc    2 Oct 2006 17:23:19 -0000       1.149
--- src/pr-output.cc    17 Oct 2006 11:07:42 -0000
*************** octave_print_internal (std::ostream& os,
*** 2329,2341 ****
          for (octave_idx_type i = 0; i < dims.numel (); i++)
            {
              int new_digits = static_cast<int> 
!               (floor (log10 (double (abs (nda(i).value ()))) + 1.0));
  
              if (new_digits > digits)
                digits = new_digits;
  
              if (! isneg)
!             isneg = (abs (nda(i).value ()) != nda(i).value ());
            }
  
          fw = digits + isneg;
--- 2329,2341 ----
          for (octave_idx_type i = 0; i < dims.numel (); i++)
            {
              int new_digits = static_cast<int> 
!               (floor (log10 (double (abs ((long)nda(i).value ()))) + 1.0));
  
              if (new_digits > digits)
                digits = new_digits;
  
              if (! isneg)
!             isneg = (abs ((long)nda(i).value ()) != nda(i).value ());
            }
  
          fw = digits + isneg;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]