Python Forum
modulo and order of operations
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
modulo and order of operations
#1
I'm using 2.7.X
Working with the following:
print 100 - 25 * 3 % 4
When i run this i get 97 as the answer.

It seems like it I should be getting 6 with a 1 as remainder
-25 * 3 = -75
then 100-75 = 25
then 25/4=6 with 1 remainder

What is it that I'm missing in understanding this? Is there a page on the forum I have missed in my search that will explain this?
Thank you for any assistance
Reply


Messages In This Thread
modulo and order of operations - by freakbot - Dec-28-2016, 04:29 AM
RE: modulo and order of operations - by Hellerick - Dec-28-2016, 04:46 AM
RE: modulo and order of operations - by Mekire - Dec-28-2016, 04:47 AM
RE: modulo and order of operations - by freakbot - Dec-28-2016, 04:58 AM
RE: modulo and order of operations - by nilamo - Dec-28-2016, 10:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replicate Excel operations with Python Lumberjack 3 1,861 May-10-2022, 01:44 AM
Last Post: Lumberjack
  Program demonstrates operations of bitwise operators without using bitwise operations ShawnYang 2 1,817 Aug-18-2021, 03:06 PM
Last Post: deanhystad
  Random Choice Operations Souls99 6 2,973 Jul-31-2020, 10:37 PM
Last Post: Souls99
  Create bot to automate operations in IQ Option JonatasCavalini 0 12,681 Jul-19-2020, 02:23 AM
Last Post: JonatasCavalini
  Two operations in two ranges salwa17 3 2,187 Jun-22-2020, 04:15 PM
Last Post: perfringo
  How to avoid slow cursor operations? sevensixtwo 0 1,870 Oct-11-2019, 02:23 PM
Last Post: sevensixtwo
  Operations on indexed variables in loop Fibulavie 1 1,954 Aug-14-2019, 06:07 AM
Last Post: fishhook
  Confused by order of operations ward 4 2,678 Jan-22-2019, 08:53 PM
Last Post: Larz60+
  Confused by this modulo equation VikramSuh 3 3,240 Sep-05-2018, 12:43 PM
Last Post: VikramSuh
  Beginner user: mathematical operations Mahdi1994 1 2,874 Mar-19-2018, 11:07 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020