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

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

[Octave-patch-tracker] [patch #10288] Implementation of Matlab function


From: Nicholas Jankowski
Subject: [Octave-patch-tracker] [patch #10288] Implementation of Matlab function tensorprod
Date: Mon, 24 Oct 2022 10:32:42 -0400 (EDT)

Follow-up Comment #7, patch #10288 (project octave):

in matlab, A and B are restricted to singles and doubles.  isnumeric allows
ints to pass as well. is that behavior desired? (I originally thought it would
be best to use isfloat() to check that, but now I can't of a case where two
ints would cause problems. Adding and multiplying should still result in an
int at output.  What about if the types are mixed? would we want it to convert
to double and output the actual result, or preserve the int class and at some
point along the way truncate the results? 

since this would be a superset of what matlab does, there's no immediate
compatibility concern with the choice.  In the interest of avoiding any output
ambiguity, I would suggest issuing a warning and promoting the int to (double
or single) if A and B are not both int, then carrying on with the normal
calculations. (assuming we don't want to just limit to type float)


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10288>

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




reply via email to

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