Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
173 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; ...
JohannesWilde's user avatar
6 votes
1 answer
260 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 ...
M.kazem Akhgary's user avatar
2 votes
0 answers
50 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
0 votes
0 answers
140 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, (...
Daan's user avatar
  • 39
1 vote
1 answer
123 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 ...
Duncan Townsend's user avatar
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
1 vote
0 answers
44 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: >>> ...
Jonatan Öström's user avatar
1 vote
1 answer
1k views

I wanted to implement the restoring division algorithm (without using the div operation) in RISCV assembly language. The algorithm I have to implement is the following . I implemented this, but it is ...
gabibbo quinto's user avatar
4 votes
1 answer
234 views

This question arose when I looked into the efficient implementation of the MRG32k3a PRNG on 32-bit processors without, or slow, support for double computation. I am particularly interested in ARM, ...
njuffa's user avatar
  • 27.1k
0 votes
3 answers
290 views

I am trying to divide two decimals and want to get the exact integer part of the result only using a\b. Consider the following example: Dim a, b As Integer a = 200 b = 2 ...
maponda1's user avatar
1 vote
2 answers
69 views

id client_id driver_id city_id status request_at 1 1 10 1 completed 2023-12-23 2 2 11 1 cancelled_by_driver 2023-12-23 3 3 12 6 completed 2023-12-23 4 4 13 6 ...
jingchun liu's user avatar
1 vote
1 answer
303 views

I get a SIGFPE exception when dividing by 0 in x86 assembly using idiv. How would I disable it from assembly? Do I need a syscall or can it be done directly in x86? Reproduction: test.asm default rel ...
Basic Block's user avatar
1 vote
1 answer
71 views

I have this piece of code from my project. It is taking all the amount from the transaction and adding it and showing how much you earned in the day. The problem is it's not showing in decimal format ...
Salik Syed's user avatar
0 votes
2 answers
376 views

I am programming an interface on this Nextion display. Specifically, I am trying to program a digital dial that rotates around a centre point. These screens are great, but they don’t have any trig ...
Eman's user avatar
  • 303
1 vote
1 answer
831 views

I am trying to create a code which would take as input 1 8-bit number in HEX form and produce the decimal equivalent. Here is my code: data segment msg1 db 10,13, "Give me a valid hex ...
Cerise's user avatar
  • 111
0 votes
0 answers
5k views

I am trying to follow the division algorithm for signed numbers (2's complement representation) based on the algorithm described here. This is the standard restoring method with M and AQ registers ...
mahmood's user avatar
  • 25.2k
1 vote
1 answer
373 views

I'm trying to create a code which divides a uint64_t by another uint64_t plus it applies rounding to the result. The code should be as fast as possible and work for all inputs (e.g. I would prefer it ...
Kevin Meier's user avatar
  • 2,634
2 votes
1 answer
71 views

Suppose you want to divide -198077031546722079779 by 23 using gas. As this dividend is larger than %rax, how do you put it in %rdx:%rax? All the books I read on assembly avoid illustrating idiv with ...
ntos's user avatar
  • 379
3 votes
1 answer
102 views

The 8086/8087/8088 MACRO ASSEMBLY LANGUAGE REFERENCE MANUAL (c) 1980 Intel Corporation mentions (Emphasis mine): ... the 8087 provides a very good approximation of the real number system. It is ...
Sep Roland's user avatar
  • 41.2k
0 votes
0 answers
158 views

I tried using the below assembly code to get the quotient and remainder for IDIV instruction, but it didn't work as expected. I use NASM as the assembler. It prints "The quotient is: -...
Daniel's user avatar
  • 11
0 votes
4 answers
342 views

I want to make sure if a number in register is a multiple of 3 using AVR Studio and assembly language but on AVR ATmega 8515 so there is no div instruction/syntax I already tried a couple method like ...
Muhammad Hafiz's user avatar
1 vote
1 answer
702 views

I am making a script to backup databases in SSMS from Powershell. I want to add a progress bar since these databases take some time to backup. This is what I have. The progress bar is popping up but ...
movement's user avatar
-3 votes
1 answer
140 views

jmp start mess1 db 'Enter 1st number: $' mess2 db 0a,0d, 'Enter 2nd number: $' nextline db 0a,0d, '$' start: mov ax, 03 int 10h mov dx, offset mess1 call printstring call input ...
JOHN PHILIP ILUSTRISIMO's user avatar
0 votes
1 answer
253 views

I'm trying to implement an integer division with rounding. Obviously, by default integer division does floor and I was thinking I could use the remainder to determine if I should add 1 to my result. ...
spizzak's user avatar
  • 1,167
0 votes
3 answers
911 views

I'm trying to divide number into groups in plain python without importing or the use of if-statements, and get the division into groups + remainder forming one extra group so that 200 / 99 would be 3, ...
Xebbexebbe's user avatar

1
2 3 4 5
14