Top "Integer-division" questions

Anything related to the integer division operation, i.e. that special form of division which is performed between two integer numbers and which in math results in a quotient and a remainder.

Why is modulus operator slow?

Paraphrasing from in "Programming Pearls" book (about c language on older machines, since book is from the late 90's): Integer …

modulo integer-division cpu-speed programming-pearls
Division of two numbers in NASM

Starting to teach myself assembly (NASM) I wanted to know how to divide 2 numbers (For instance on Windows). My code …

assembly x86 nasm integer-division
When and why do we sign extend and use cdq with mul/div?

I had a test todayand the only question I didn't understand involved converting a doubleword to a quad word. That …

assembly x86 division integer-division sign-extension
Modulus division when first number is smaller than second number

I apologize if this is a simple question but I'm having trouble grasping the concept of modulus division when the …

java modulo integer-division arithmetic-expressions
Causing a divide overflow error (x86)

I have a few questions about divide overflow errors on x86 or x86_64 architecture. Lately I've been reading about integer …

c++ c assembly x86 integer-division
How can I perform 64-bit division with a 32-bit divide instruction?

This is (AFAIK) a specific question within this general topic. Here's the situation: I have an embedded system (a video …

math assembly cpu-architecture fixed-point integer-division
Is "long x = 1/2" equal to 1 or 0, and why?

if I have something like: long x = 1/2; shouldn't this be rounded up to 1? When I print it on the screen …

java c long-integer integer-division
How to divide the integer value

I want to perform integer division in VB.NET, i.e. only keep the whole part of division result. Dim …

vb.net integer-division
Integer division algorithm

I was thinking about an algorithm in division of large numbers: dividing with remainder bigint C by bigint D, where …

c++ algorithm performance integer-division bigint
Floor division with negative number

The expression 6 // 4 yields 1, where floor division produces the whole number after dividing a number. But with a negative number, why …

python python-3.x division integer-division