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
2 answers

Get divisible numbers in a range without certain operators (+, -, /, *, %, += %=, etc)

find numbers in an input range that are evenly divisible by 3. Only =, ++, -- operators can be used. I've tried to get the remainder using shift operators and other loops but I always require a -= or something similar. Console.Clear(); …
BPierce
  • 53
  • 5
0
votes
1 answer

Dividing two Big Integers with mod in Java

I am working on a cryptography assignment with BigIntegers in Java. And I have these two numbers: s1= r mod(N) s2= r * x mod(N) I know the values of s1, s2, and N but I don't know the value of r and I need to retrieve x. Normal division of s1/s2…
0
votes
2 answers

Opeartion on a variable and constant giving different result in c

A simple calculation: 3^20%15. The answer, according to a calculator, is 6. The following code generates answer 7. #include #include int main() { int i = 20; printf("%d\n", ((int)pow(3,20)%15)); return…
user8836512
0
votes
1 answer

How to use the mod function on LISPS using control structures

I am new to LISP, is there a way of using mod with control structures, if statements. for instance having (if (mod 4 2) (+ 2 2) (- 9 2)). What does the expression return, 0, nil, T?
user9414520
0
votes
1 answer

VB.NET Xor + Mod

I'm very new to VB.NET language so there are some things I'm still learning and I need some help here. So I'd appreciate any guidance. I'm making an XOR encryption app where there's a key, input and output. The flow is like this: Key XOR Input and…
user10504780
0
votes
1 answer

How to convert decimal to binary in excel without using the engineering functions

I am trying to learn the fundamentals behind the conversion of binary to decimal/Hex/Oct. For now I am focusing on decimal to binary conversion, without the use of the engineering functions dec2bin. I haven't found much online regarding this. Thus…
Jonny
  • 19
  • 1
  • 7
0
votes
0 answers

Django server works, Apache doesn't

I'm running Django with Python 3.6.1 on Ubuntu 14.04 and Apache 2.4.7 and using mod_wsgi 4.4.12 compiled with Python 3.6.1. If I start the Django server independently of my app and go to 127.0.1.1:8000, my app shows up just fine. If I let my app…
Terri Simon
  • 127
  • 1
  • 10
0
votes
0 answers

Using mod for doubles on CGAL

I've been looking around on the web for this but cannot find anything. Is there a way to use the CGAL::mod() function with 2 doubles? I can do CGAL::mod(2,3) but not CGAL::mod(2.0,3.5) for example. I get errors like this on compiling: error: no…
David Merinos
  • 1,195
  • 1
  • 14
  • 36
0
votes
1 answer

MOD operator in Teradata SQL Assistent 15

can't understand why my old sripts didn't work. Problem in MOD operator. SELECT MOD(20,2) Error: Query failed. 3706: Syntax error ... Can't understand why MOD operator doesnt work any more. Teradata SQL Assistent 15.10
0
votes
0 answers

php mod division (%) with floats

What is going on here: 12 % 4 = 0; // integers (1.2 / 0.1) % 4 = 3; // floats (12) % 4 = 3! $a = 1.2 / 0.1; $b = ((int)$a) % 4; $c = 12 % 4; print_r([ $a, $b, $c, ]);
luky
  • 2,263
  • 3
  • 22
  • 40
0
votes
0 answers

Vhdl, is there a way, to use modulo on larger than 64 bits unsigned?

I've got two 115bits unsigned vectors. I have to do some mod calculations on them, but Quartus shows those errors. Error: In lpm_divide megafunction, LPM_WIDTHN must be less than or equals to 64 Error: In lpm_divide megafunction, LPM_WIDTHD must be…
0
votes
1 answer

Multiple conditions in While loop JS

I don't really see how this could be wrong code. In few examples, there is no output at all or it's only "10" in this one. var num2 = 10; while (num2 >= 10 && num2 <= 40 && num2%2===0){ console.log(num2); num2++; } or like this: var…
0
votes
1 answer

How to filter requests so that apache handles them and not tomcat?

For various reasons I want to shutdown my server after a certain period of idle time. I am running Tomcat 8.5.29 and Apache2 (not sure the version) on Debian 4.9.88. I wrote a script to look at the last time Tomcat had an access. I only have one app…
0
votes
0 answers

whenever i enter 1 as input for the array the output says time exceeded, the code works fine with all other natural number

//initialization int N,chk=1,div=1,count=0; //accepting input N = s.nextInt(); //initializing array int [] a = new int[N]; for (int i=0;i
shazam
  • 1
  • 2
0
votes
1 answer

Compile issue with mod_brotli and apache 2.4.33

Getting the below issue with including mod_brotli support for Apache 2.4.33. I compiled brotli which compiled fine but when i enable it in apache configure script using --enable-brotli and --with-brotli=/apps/httpdx64/brotli. I get the below error…
AR01
  • 21
  • 5