octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #58147] Matlab 2020 compatibility: dec2bin, de


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #58147] Matlab 2020 compatibility: dec2bin, dec2hex shouldn't error on negative inputs
Date: Fri, 10 Apr 2020 13:55:10 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36

Follow-up Comment #7, bug #58147 (project octave):

I would think something like this (untested)


if (d < intmin ("int64"))
  error ("out of range");
elseif (d < intmin ("int32"))
  d += double (intmax ("uint64"));
elseif (d < intmin ("int16"))
  d += double (intmax ("uint32"));
elseif (d < intmin ("int8"))
  d += double (intmax ("uint16"));
elseif (d < 0)
  d += double (intmax ("uint8"));
endif


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58147>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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