Top "Division" questions

In mathematics, division (÷) is an arithmetic elementary operation.

Assembly Language: cbw

I am unsure of what the cbw command actually does. I have a snippet of code: mov ax,0FF0h …

assembly x86 division sign-extension
When is the difference between quotRem and divMod useful?

From the haskell report: The quot, rem, div, and mod class methods satisfy these laws if y is non-zero: (x `…

haskell division
Python-style integer division & modulus in C

In Python and Ruby, signed integer division truncates towards negative infinity, and signed integer modulus has the same sign the …

java c++ c modulo division
Why is 0 divided by 0 an error?

I have come across this problem in a calculation I do in my code, where the divisor is 0 if the …

math division divide-by-zero
Why does (360 / 24) / 60 = 0 ... in Java

I am trying to compute (360 / 24) / 60 I keep getting the answer 0.0 when I should get 0.25 In words: I want to divide 360 …

java floating-point division
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
What is the fastest way to perform hardware division of an integer by a fixed constant?

I have a 16 bit number which I want to divide by 100. Let's say it's 50000. The goal is to obtain 500. However, …

algorithm division system-verilog
Perform integer division using multiplication

Looking at x86 assembly produced by a compiler, I noticed that (unsigned) integer divisions are sometimes implemented as integer multiplications. …

assembly optimization bit-manipulation division multiplication
Unsigned 128-bit division on 64-bit machine

I have a 128-bit number stored as 2 64-bit numbers ("Hi" and "Lo"). I need only to divide it by a 32…

64-bit division integer-division 128-bit