Negative Modulo Operator in Python

preview_player
Показать описание
#python #programming

The modulo operation on negative numbers in Python
Рекомендации по теме
Комментарии
Автор

definitely the easiest explanation to inderstand it i have found

ilyaas
Автор

I'm very pleased to see this video
Nice Explanation

AmitVermashorts
Автор

MANNNN ! LITERALLY AWESOMEEE THANK YOU LAKH TIMES... YOU MADE MY DAYY
YOU CLEARED MY YEAR OLD DOUBT 🙏🙏

hariharan
Автор

The best and the most simple trick ive ever heard, thank you !

racefan
Автор

Thank you so much!! tomorrow is my exam and you cleared my huge doubt! THANK YOU!

tarunsenthilkumar
Автор

Really useful and perfect explanation, Thank so much

iron_rod
Автор

wow the simplest explanation i have found

egtechgguylofi
Автор

Thank you so much . Tomorrow is my exam it will gonna help me a lot. ❤️

_xyz
Автор

*OP Concepts:*

# a%-b : Subtract -b to +a until you reach either 0 or negative number.

# -a%b : Add +b to -a until you reach either 0 or positive number.

Hammad-ft
Автор

Thank you soo much it's really helped me.

rukshanakhatoon
Автор

I would suggest that for either case, modulo operator 'adds' the second number to the first number until a 0 or a positive number is obtained. Consider this: 20 - 6 = 20 + (-6).
Anyway, your explanation is really helpful. Could you tell if the same logic is followed for floor divison operator as well?

anupamkatiyar
Автор

This is my observation, for a mod b = r, we have either r=0, or r must have same sign (+ or -) as b.

johnjohnchu
Автор

Thanks. Can you also make a video to explain how you solve when interger on the left is less than interger on right..e.g 2%4.

alexhjohno
Автор

When both numbers are negative what is the

Is it the similar logic for / and // ?

aryanpatnaik
welcome to shbcf.ru