Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
2 votes
1 answer
187 views

I am trying to call idiv r/m8 using MSVC2022's current Microsoft Visual C++ Compiler 17.4.33403.182 and C++. Using the most straightforward approach: struct cdiv_t { // char std::int8_t quot; ...
2 votes
2 answers
187 views

For GCC's __int128 type __int128 div128(__int128 a, __int128 b) {return a / b;} GCC will generate a call to __divti3 instead of inline assembly. So where is this actually defined? Github's search ...
qwr's user avatar
  • 11.6k
6 votes
1 answer
267 views

I have a fixed-point math-heavy project and I was looking to speed up integer divisions. I tested double division with SSE4 and AVX2 and got nearly 2x speedup versus scalar integer division. I wonder ...
1 vote
0 answers
151 views

I have a serious problem I really want to solve. I am trying to implement void operator divide(uint32_t dividend[4],int32_t divisor,uint32_t &quotient[4],int32_t &remainder). My algorithm is: ...
2 votes
0 answers
51 views

It is well-known that integer division can result in errors, no matter which rounding method is used (we use Floor rounding below as example). Moreover, if division is calculated multiple times (with ...
wub's user avatar
  • 525
4 votes
2 answers
237 views
0 votes
0 answers
150 views

I want to implement Knuth's Algorithm D for division on C (Link to Knuth's book, p272). In step "D4. [Multiply and subtract.]", it states: if the result of this step is actually negative, (...
33 votes
1 answer
4k views

I am calculating the number of routes possible in a 20 * 20 grid from top left to bottom right when only down and right moves are possible. I read about calculating the central binomial coefficient to ...
1 vote
1 answer
129 views

Knuth Algorithm D, during the normalization step (D1), states to set d to (b-1)//v_hi where b is the basis (word size or half-word size) and v_hi is the upper limb of the denominator. Then multiply ...
1 vote
0 answers
111 views

I've found that the rule for rounding two int in Java is to get the value closer to 0. Which mean that if you divide two positive numbers, you get the "floor" value e.g 7/3=2. And if you ...
arso's user avatar
  • 2,365
1 vote
1 answer
59 views

In the macro below I get an Overflow error when calculating Rate = cell.Offset(0, 7).Value / cell.Offset(0, 2).Value - regardless of whether Rate is declared as Long or Double. Kindly help to identify ...
cdfj's user avatar
  • 167
0 votes
1 answer
110 views

I want to divide uint64 by a uint32 in WebGPU, which currently only handles uint32 operations. So I am trying to simulate this by storing my long into two uint32 buffers high and low. and now I want ...
RRR's user avatar
  • 529
1 vote
1 answer
107 views

My program keeps producing incorrect quotients. What do you think is wrong with it? This is the code: divide proc ; Set cursor position for PROMPT_1 mov ah, 02h mov bh, 00h mov dh, 0Bh ...
1 vote
0 answers
50 views

The operator // for integer division is called "floor division" in the python documentation, but comparing to other floor implementations there is a discrepancy, for example: >>> ...
6 votes
1 answer
4k views

In terms of the resulting value (ignoring the resulting data type), are the following the same in Python if x and y are both numbers? int(x / y) x // y If so, which is better to use in real ...

15 30 50 per page
1
2 3 4 5
...
44

AltStyle によって変換されたページ (->オリジナル) /