Shouldn't remainder be always less than divisor? [duplicate]












1












$begingroup$



This question already has an answer here:




  • Negative quotients and their remainders

    1 answer




When dealing with negative modulo such as



7 (mod -5) = -3



is it not necessary that remainder be less than divisor?



I thought modulo should always be positive but the calculator certainly



seem to have no problem with negative modulo.



Does the rules change when dealing with negative modulos?










share|cite|improve this question









$endgroup$



marked as duplicate by Bill Dubuque modular-arithmetic
Users with the  modular-arithmetic badge can single-handedly close modular-arithmetic questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 16 '18 at 23:31


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    1












    $begingroup$



    This question already has an answer here:




    • Negative quotients and their remainders

      1 answer




    When dealing with negative modulo such as



    7 (mod -5) = -3



    is it not necessary that remainder be less than divisor?



    I thought modulo should always be positive but the calculator certainly



    seem to have no problem with negative modulo.



    Does the rules change when dealing with negative modulos?










    share|cite|improve this question









    $endgroup$



    marked as duplicate by Bill Dubuque modular-arithmetic
    Users with the  modular-arithmetic badge can single-handedly close modular-arithmetic questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Dec 16 '18 at 23:31


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      1












      1








      1





      $begingroup$



      This question already has an answer here:




      • Negative quotients and their remainders

        1 answer




      When dealing with negative modulo such as



      7 (mod -5) = -3



      is it not necessary that remainder be less than divisor?



      I thought modulo should always be positive but the calculator certainly



      seem to have no problem with negative modulo.



      Does the rules change when dealing with negative modulos?










      share|cite|improve this question









      $endgroup$





      This question already has an answer here:




      • Negative quotients and their remainders

        1 answer




      When dealing with negative modulo such as



      7 (mod -5) = -3



      is it not necessary that remainder be less than divisor?



      I thought modulo should always be positive but the calculator certainly



      seem to have no problem with negative modulo.



      Does the rules change when dealing with negative modulos?





      This question already has an answer here:




      • Negative quotients and their remainders

        1 answer








      modular-arithmetic






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 16 '18 at 22:24









      user10344621user10344621

      61




      61




      marked as duplicate by Bill Dubuque modular-arithmetic
      Users with the  modular-arithmetic badge can single-handedly close modular-arithmetic questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Dec 16 '18 at 23:31


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Bill Dubuque modular-arithmetic
      Users with the  modular-arithmetic badge can single-handedly close modular-arithmetic questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Dec 16 '18 at 23:31


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          3












          $begingroup$

          In number theory, "$pmod n$" usually isn't an operation. It's most often part of $equiv$. So, for instance, $5equiv 2pmod 3$ doesn't mean that if you apply a "modulus 3 operation" to $5$, you get $2$. It means that $5$ and $2$ are congruent modulo $3$. In other words, that they are some multiple of $3$ apart.



          So there is no problem at all with saying $5equiv 8pmod 3$, or $5equiv-4pmod3$.



          We also get that $pmod n$ and $pmod{{-}n}$ are equivalent, so we usually don't use negative modulus, because it doesn't give us anything at all.



          As for the % (modulo) operator in programming languages, and on calculators, how they behave with negative numbers is partially up to whoever designed it. There are several equally correct ways to do it. Some may have opinions on which way is the "best", I personally haven't used them enough to make up my mind.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:08












          • $begingroup$
            @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
            $endgroup$
            – Arthur
            Dec 16 '18 at 23:12












          • $begingroup$
            Often it is merely a misunderstanding of notation - as is likely here.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:21




















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3












          $begingroup$

          In number theory, "$pmod n$" usually isn't an operation. It's most often part of $equiv$. So, for instance, $5equiv 2pmod 3$ doesn't mean that if you apply a "modulus 3 operation" to $5$, you get $2$. It means that $5$ and $2$ are congruent modulo $3$. In other words, that they are some multiple of $3$ apart.



          So there is no problem at all with saying $5equiv 8pmod 3$, or $5equiv-4pmod3$.



          We also get that $pmod n$ and $pmod{{-}n}$ are equivalent, so we usually don't use negative modulus, because it doesn't give us anything at all.



          As for the % (modulo) operator in programming languages, and on calculators, how they behave with negative numbers is partially up to whoever designed it. There are several equally correct ways to do it. Some may have opinions on which way is the "best", I personally haven't used them enough to make up my mind.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:08












          • $begingroup$
            @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
            $endgroup$
            – Arthur
            Dec 16 '18 at 23:12












          • $begingroup$
            Often it is merely a misunderstanding of notation - as is likely here.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:21


















          3












          $begingroup$

          In number theory, "$pmod n$" usually isn't an operation. It's most often part of $equiv$. So, for instance, $5equiv 2pmod 3$ doesn't mean that if you apply a "modulus 3 operation" to $5$, you get $2$. It means that $5$ and $2$ are congruent modulo $3$. In other words, that they are some multiple of $3$ apart.



          So there is no problem at all with saying $5equiv 8pmod 3$, or $5equiv-4pmod3$.



          We also get that $pmod n$ and $pmod{{-}n}$ are equivalent, so we usually don't use negative modulus, because it doesn't give us anything at all.



          As for the % (modulo) operator in programming languages, and on calculators, how they behave with negative numbers is partially up to whoever designed it. There are several equally correct ways to do it. Some may have opinions on which way is the "best", I personally haven't used them enough to make up my mind.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:08












          • $begingroup$
            @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
            $endgroup$
            – Arthur
            Dec 16 '18 at 23:12












          • $begingroup$
            Often it is merely a misunderstanding of notation - as is likely here.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:21
















          3












          3








          3





          $begingroup$

          In number theory, "$pmod n$" usually isn't an operation. It's most often part of $equiv$. So, for instance, $5equiv 2pmod 3$ doesn't mean that if you apply a "modulus 3 operation" to $5$, you get $2$. It means that $5$ and $2$ are congruent modulo $3$. In other words, that they are some multiple of $3$ apart.



          So there is no problem at all with saying $5equiv 8pmod 3$, or $5equiv-4pmod3$.



          We also get that $pmod n$ and $pmod{{-}n}$ are equivalent, so we usually don't use negative modulus, because it doesn't give us anything at all.



          As for the % (modulo) operator in programming languages, and on calculators, how they behave with negative numbers is partially up to whoever designed it. There are several equally correct ways to do it. Some may have opinions on which way is the "best", I personally haven't used them enough to make up my mind.






          share|cite|improve this answer











          $endgroup$



          In number theory, "$pmod n$" usually isn't an operation. It's most often part of $equiv$. So, for instance, $5equiv 2pmod 3$ doesn't mean that if you apply a "modulus 3 operation" to $5$, you get $2$. It means that $5$ and $2$ are congruent modulo $3$. In other words, that they are some multiple of $3$ apart.



          So there is no problem at all with saying $5equiv 8pmod 3$, or $5equiv-4pmod3$.



          We also get that $pmod n$ and $pmod{{-}n}$ are equivalent, so we usually don't use negative modulus, because it doesn't give us anything at all.



          As for the % (modulo) operator in programming languages, and on calculators, how they behave with negative numbers is partially up to whoever designed it. There are several equally correct ways to do it. Some may have opinions on which way is the "best", I personally haven't used them enough to make up my mind.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Dec 16 '18 at 23:24









          Bill Dubuque

          210k29192644




          210k29192644










          answered Dec 16 '18 at 22:55









          ArthurArthur

          115k7116198




          115k7116198












          • $begingroup$
            The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:08












          • $begingroup$
            @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
            $endgroup$
            – Arthur
            Dec 16 '18 at 23:12












          • $begingroup$
            Often it is merely a misunderstanding of notation - as is likely here.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:21




















          • $begingroup$
            The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:08












          • $begingroup$
            @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
            $endgroup$
            – Arthur
            Dec 16 '18 at 23:12












          • $begingroup$
            Often it is merely a misunderstanding of notation - as is likely here.
            $endgroup$
            – Bill Dubuque
            Dec 16 '18 at 23:21


















          $begingroup$
          The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
          $endgroup$
          – Bill Dubuque
          Dec 16 '18 at 23:08






          $begingroup$
          The binary operation $bmod$ is also used in mathematics, e.g. $ 10bmod 9 = 1,,$ and that its likely what the OP intended.
          $endgroup$
          – Bill Dubuque
          Dec 16 '18 at 23:08














          $begingroup$
          @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
          $endgroup$
          – Arthur
          Dec 16 '18 at 23:12






          $begingroup$
          @BillDubuquque You may be right. I changed the wording slightly to be more correct. Although the binary operation with that notation is not used nearly as often as the relation version to my knowledge. Most of the time I see these kinds of questions on this site, it's due to misunderstanding the relation and thinking it's an operation.
          $endgroup$
          – Arthur
          Dec 16 '18 at 23:12














          $begingroup$
          Often it is merely a misunderstanding of notation - as is likely here.
          $endgroup$
          – Bill Dubuque
          Dec 16 '18 at 23:21






          $begingroup$
          Often it is merely a misunderstanding of notation - as is likely here.
          $endgroup$
          – Bill Dubuque
          Dec 16 '18 at 23:21





          Popular posts from this blog

          Ellipse (mathématiques)

          Quarter-circle Tiles

          Mont Emei