Questions tagged [mod]

For questions related with the *mod operation*, that can arise in Cryptography, Number Theory, Hashing, etc..

In computing, the modulo operation finds the remainder after division of one number by another (sometimes called modulus). Given two positive numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder of the Euclidean division of a by n.

437 questions
0
votes
1 answer

woocommerce display tag description on product page

I looked around for a while today for a way to display a tag description on the product page. But could not find a close answer to my issue of displaying a tag description. I know if you have more than one tag on a page and it pulls in all tag…
WO_PGH
  • 11
  • 2
0
votes
1 answer

Unity window title and elements text is not show (KSP)

I'm a newbie in KSP mod creation, trying to make a GUI for my mod. I caught an issue with displaying text on GUI elements. For example I created a window with button and window had no title, button had no text on it. Button is work and I see debug…
alsktel
  • 1
  • 2
0
votes
0 answers

Integer Overflow in a problem while using cout statement although i am using mod

cout<<((n%mod*n%mod)%mod) when the value of n is: 2248813659738258 my output is : -840739582 However this problem is resolved when using 'printf' instead of cout the reason for this problem??.
Ryednap
  • 324
  • 1
  • 9
0
votes
1 answer

Changing Maps In Game

I want to change the map in Rainbow Six Siege like when i start any map in custom game and load any other map. Please Help Example: I select House Map in custom game And Change something from cheat engine or change some hex codes then start i get…
0
votes
1 answer

Can you explain the use of modulo operator in an if statement

m = 1 my_list_1 = [2 , 4, 1] for x in my_list_1: for y in range(1,3): if (x + y) % 3: m = m * x print (m) In line 5, what does the modulo operator do. Doesn't is need something like == 1?
Bobby
  • 11
  • 1
0
votes
1 answer

Overflow in simple C program

I am learning to code in C and need to get more familiar with overflow and dealing with large numbers. I need help dealing with the below code. This isn't my desired output as when I do the calculations on my own, the negative numbers are incorrect.…
Nadine
  • 11
  • 1
0
votes
2 answers

Oracle- sql query to print odd number of rows when we do not have number data type columns

I was trying to print odd numbers of rows from my table without taking taking help of my numeric cloumns when I try to execute this query I was getting only first row. select * from emp3 where mod(rownum,2)=1; emp3 is my table name. and when I use…
Rohith
  • 135
  • 1
  • 10
0
votes
1 answer

Quotient in R to hold position in a matrix

Let's assume these are our numbers and we are looking for mod for them which we can find them using library(pracma) > mod(c(1,4,23,13,8,9,11,27,32,2),7) > [1] 1 4 2 6 1 2 4 6 4 2 I want to get a number to see where each number is coming from when…
iHermes
  • 314
  • 3
  • 12
0
votes
0 answers

create go mod project with github path no work in GoLand?

I created a go mod project with github path like that. go mod init github.com/txt2pdf But when I import my own package on Goland like below, Goland did not recognize my package. enter image description here This is the directory tree of my…
李逍遥
  • 51
  • 1
0
votes
0 answers

numpy int larger than 63 bit gives incorrect calculation

Calculating modulo with numpy for large integer (>63 bits) sometimes gives incorrect results. For example: import numpy numpy.mod(12345678912345679000, 3) numpy.mod(12345678912345679001, 3) numpy.mod(12345678912345679002, 3) all give the result of…
Tim
  • 3,178
  • 1
  • 13
  • 26
0
votes
1 answer

Modulus in Matlab for large numbers without toolbox

I am porting some of my Python code to Matlab and have encountered an issue when doing mod calculations in Matlab, resulting in NaN being returned instead of the correct value like Python. In Python the code is p =…
0
votes
1 answer

How do I calculate 'hits' here without the loop?

#include int main() { int ix; unsigned hits = 0; for (ix=0; ix < 128; ix++) { if (ix % 4 == 0) continue; hits++; } printf("%u hits\n", hits); return; } This isn't a…
Level 42
  • 400
  • 2
  • 7
0
votes
1 answer

problem with mod and inverse modulo in Shamir Secret Sharing

I have a problem with modulo sharing, I don't know why the parameters given are incorrect Error C2660: inverse_modulo does not take 2 arguments C++ Error C2660: mod does not take 2 arguments C++ int inverse_modulo(int a, int p, int is, int ij) { …
Kubazooo
  • 115
  • 1
  • 6
0
votes
1 answer

Using modulus to solve coin change question

I'm looking for a different way to solve coin change problem using modulus. Most solutions refer to use of dynamic memory to solve this. Example: You are given coins of different denominations and a total amount of money amount. Write a function…
0
votes
2 answers

Mod Operation for Negative number XSLT

I am trying to put logic in XSL to get the value. 1+ mod(DateDifference ,number) DateDifference can be positive or a negative number and formula should work in all scenarios whether date diff is +ve, -ve or 0. This formula in XSL is not working…