Group Abstract Group Abstract

Message Boards Message Boards

0
|
78 Views
|
3 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Traditional division of integers with remainder in Wolfram

Posted 14 hours ago

As is well known, division of integers with remainder can be defined in different ways. The definition in Wolfram and the definition in theoretical mathematics are different. How to express traditional division with remainder in Wolfram? Here is a variant solution:

quotient[m_, n_] := (m - Mod[m, Abs[n]])/n
remainder[m_, n_] := Mod[m, Abs[n]]

Is there anything more elegant?

POSTED BY: Sasha Mandra
3 Replies
Posted 8 hours ago

Have you tried the function QuotientRemainder ?

In[6]:= QuotientRemainder[14, 5]
Out[6]= {2, 4}
POSTED BY: Hans Milton
Posted 9 hours ago

Thank you! I knew Wolfram had thought of everything.

POSTED BY: Sasha Mandra

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard