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

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

[Octave-bug-tracker] [bug #59719] dec2bin issues an error for non-intege


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #59719] dec2bin issues an error for non-integer inputs while Matlab does not
Date: Fri, 18 Dec 2020 14:25:20 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Follow-up Comment #5, bug #59719 (project octave):

just peeking at similar functions:

Matlab dec2hex:

D — Input array
numeric array
Input array, specified as a numeric array.

If D is an array of floating-point numbers, and any element of D has a
fractional part, then dec2hex produces an error. For example, dec2hex converts
10 to 'A', but does not convert 10.5.

If D is a character or logical array, then dec2hex treats the elements of D as
integers. However, dec2hex treats characters as their Unicode® values, so
specifying D as a character array is not recommended.

Since R2020a

D can include negative numbers. The function converts negative numbers using
their two's complement binary values.


matlab dec2base:

D — Input array
array of nonnegative numbers
Input array, specified as an array of nonnegative numbers. Each element of D
must have a value between zero and the value returned by flintmax.

If D is an array of floating-point numbers, and any element of D has a
fractional part, then dec2base produces an error. For example, dec2base(10,8)
converts 10 to '12', but dec2base(10.5,8) produces an error.

If D is a character or logical array, then dec2base treats the elements of D
as integers. However, dec2base treats characters as their Unicode values, so
specifying D as a character array is not recommended.


so seems like only dec2bin has this particular issue, the others produce
errors.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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