Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
modulus
- Page 1
Re: modulus operator %
Programming
Software Development
14 Years Ago
by Shankye
… is 3 .. First 3*3*3 gives 27 thn
modulus
operator gives remainder of 27%4 Hence ans is 3..…operator precedence in C [COLOR="Red"]* / % Multiplication/division/
modulus
left-to-right[/COLOR] so first multiplication is done and… thn division if any and thn
modulus
operator comes.. Hence the result 3..
Re: modulus operator %
Programming
Software Development
14 Years Ago
by ankitcuul
… [B][U]Shankye[/U][/B] As u already know that
modulus
operator gives the remainder of the division of two operands… proove this thing u might have notinced this that the
modulus
operator gives same result for the operation (x%y) if…
modulus operator %
Programming
Software Development
19 Years Ago
by degamer106
Hmm I was lookin through a recursion program in this book i have here and the only thing I'm having trouble with is the
modulus
operator. I know that it returns the remainder of 2 numbers. But, suppose I have this: x % y If x > y then the result is x. Am I tripping out o_O?
Re: modulus operator %
Programming
Software Development
14 Years Ago
by Auraomega
I think you've misunderstood how
modulus
works, or maybe I've misunderstood you :P Basically in …
Re: determining a interger if divisible without using modulus
Programming
Software Development
14 Years Ago
by griswolf
Modulus
operator is the right thing to use. Why not? However, …
Re: Modulus bug
Programming
Software Development
13 Years Ago
by zeroliken
It's not really a bug, the
modulus
is doing whats its suppose to do are you trying to make the program display 0 when 30 or a similar case is entered?
Re: modulus operator
Programming
Software Development
11 Years Ago
by gerard4143
Well 3 divided by 5 has 3 left over. The
modulus
operator computes the remainder of integer division.
Re: modulus operator
Programming
Software Development
11 Years Ago
by JasonHippy
The
modulus
operator returns the remainder after the division operation. So 3%5 returns 3 because 3 divides by 5 zero times and the remainder is 3.
Need help in assembly code with modulus
Programming
Software Development
15 Years Ago
by slicer
…++ it is hard for me to understand the concept of
modulus
as all I use is the symbol % to compute. The… exponent of X to the Y power and then the
modulus
of this answer with Z. Where X, Y, and … is greater than 1 jump to loop mod al,dl ;???
MODULUS
??? I know this isn't ;right, it is the part…
Using modulus
Programming
Computer Science
16 Years Ago
by noodlecode
For newer programmers, myself included,
modulus
is probably the most obscure operator. ie easy to understand,… use for. But when you see an algorithm that uses
modulus
, it immediately makes sense. How about a few samples where…
modulus
works well. For example, is a number odd or even …
Re: Need help in assembly code with modulus
Programming
Software Development
14 Years Ago
by thines01
… remainder in DX int 20h ;C:\science\asm>debug
MODULUS
.COM ;-r ;AX=0000 BX=0000 CX=000A DX=0000… DX int 20h ; BYTE Example ;C:\science\asm>debug
MODULUS
.COM ;-r ;AX=0000 BX=0000 CX=000A DX=0000…
Re: Need help in assembly code with modulus
Programming
Software Development
14 Years Ago
by thines01
...all of that means you get the
modulus
by calling DIV. The
modulus
will be in AH (for BYTE division) or in DX (for WORD division).
Where does Modulus fit in with PEMDAS?
Programming
Software Development
16 Years Ago
by Alex Edwards
… but I would rather not until I can determine where
modulus
fits in with PEMDAS. To those who don't know…. Now my problem is that I don't know where
Modulus
fits in with PEMDAS. Does it have higher or lower…
Re: Where does Modulus fit in with PEMDAS?
Programming
Software Development
16 Years Ago
by dougy83
….cppreference.com/wiki/operator_precedence[/url] You're right, division/multiplication/
modulus
all have equal precedence. [QUOTE=VernonDozier;731746] ... It's one…;2 operators having equal precedence (i.e. when you add
modulus
to the mix).
Re: Where does Modulus fit in with PEMDAS?
Programming
Software Development
16 Years Ago
by Alex Edwards
… or subtract first. Are you using unsigned types? And if
modulus
has equal precedence then I suppose my program is technically… when you say I need a third option (i.e.
Modulus
before Division but after Multiplication), when M and D are…
Re: Where does Modulus fit in with PEMDAS?
Programming
Software Development
16 Years Ago
by VernonDozier
… or subtract first. Are you using unsigned types? And if
modulus
has equal precedence then I suppose my program is technically… when you say I need a third option (i.e.
Modulus
before Division but after Multiplication), when M and D are…
Re: Using modulus
Programming
Computer Science
16 Years Ago
by tux4life
You can use the
modulus
operator to convert numbers to another base (e.g: from decimal to octal/hexadecimal/binary/etc.) ...
Re: Using modulus
Programming
Computer Science
16 Years Ago
by tux4life
[QUOTE=tux4life;841781]You can use the
modulus
operator to convert numbers to another base (e.g: from decimal to octal/hexadecimal/binary/etc.) ...[/QUOTE] Look at [URL="http://www.daniweb.com/code/snippet104.html"]this[/URL] code snippet on Daniweb ...
Re: Using modulus
Programming
Computer Science
16 Years Ago
by thoughtcoder
For algorithms that directly require modular arithmetic, such as some encryption algorithms. For writing log messages every Nth time through a loop. The "do something every Nth time through a loop" problem is probably where you'll see the
modulus
operator used most often.
Re: Using modulus
Programming
Computer Science
16 Years Ago
by MosaicFuneral
[QUOTE=thoughtcoder;841923]The "do something every Nth time through a loop" problem is probably where you'll see the
modulus
operator used most often.[/QUOTE] I generally just use the logical AND operator for that.
integer division / modulus controlled looping
Programming
Software Development
14 Years Ago
by Griff0527
…), but cannot figure out how to use integer division and
modulus
as a loop control. Can someone help explain it to… to C++ documentation describing how to use int division and
modulus
as a loop control. Thank you, Griff0527 [CODE] #include <…
How to find large modulus on Casio fx-991 MS
Programming
Computer Science
11 Years Ago
by logicslab
Hi pals, I am looking to find a
modulus
calculation using my casio fx-991 ms calculator i know …how to find
modulus
using small numbers eg: 7 mod 3 = 1. This because…
Re: Where does Modulus fit in with PEMDAS?
Programming
Software Development
16 Years Ago
by Alex Edwards
Bah nevermind, I'll keep it as it is. Thanks for confirming the precedence of
modulus
!
Re: integer division / modulus controlled looping
Programming
Software Development
14 Years Ago
by Griff0527
… am trying to understand how to use integer division and
modulus
to do the same thing as using a character to…
hellp with modulus
Programming
Software Development
19 Years Ago
by mina1984
hey, um i was wondering if anyone could help me with a program where if the user inputs a number no more than 5 digits and the program tells you how many times the number 2 appears in that number. i know that the
modulus
and division have to be used but i dont know how to set that part up can someone help?? thanxxxx
queue and modulus question
Programming
Software Development
19 Years Ago
by degamer106
I'm kind of confused about how the
modulus
operator works. Suppose i have x % y with x > …
Using Modulus
Programming
Software Development
18 Years Ago
by wanda
When using the
modulus
, if a<b, then a%b = a. But why, if a is negative, does -a%b = -a? According to the division algorithm, the remainder r must be >= 0 and <|b|.
Use modulus operator to convert time
Programming
Software Development
15 Years Ago
by JHus00
I need to convert hours into weeks, days, and hours. My professor was hinting that there might be a way to do this using the
modulus
operator but I can't seem to think of a way that its possible. Can anyone help? thanks!
determining a interger if divisible without using modulus
Programming
Software Development
14 Years Ago
by acejhon
helo guys good day... i have a problem in python programming... im new to this langauage.. im having a bit problem on creating a program in python that would determine if the integer is divisible by 3 or not without using a
modulus
? im glad if you can help me .... im willing to know more about this language... thanks...... =)
Stuck using modulus.
Programming
Software Development
14 Years Ago
by Urv73
… of seconds into hours, minutes and seconds. I wanna use
modulus
to get the result I'm looking for. I KNOW…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC