Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
227 views

I am trying to solve the problem posed in this question which asks that division of two numbers be performed in a bitwise manner. So, I wrote the following functions. sum() adds two numbers. larger() ...
uran42's user avatar
  • 469
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 ...
M.kazem Akhgary's user avatar
0 votes
2 answers
105 views

I am trying to record CPU and memory utilizations of processes running in my window server using PowerShell. Script is running well but I am not getting anything if Mutiple process are running with ...
Vineet's user avatar
  • 37
0 votes
2 answers
96 views

1st: I want to write a function "div" that takes two numbers as parameters and returns the quotient of the first number divided by the second number. and need to use a try-except statement ...
Kasun98's user avatar
  • 33
0 votes
0 answers
39 views

Suppose I have the following code within a VBA script: Dim Start As Long Dim Final As Long Dim Rate As Long Start = 10 End = 9 Rate = Final / Start MsgBox("Rate Variable = " + CStr(Rate) + ...
thnkwthprtls's user avatar
  • 3,517
0 votes
1 answer
70 views

I was having trouble following an example in The Art of Computer Programming, (3rd Ed.) by Donald Knuth. I figured it out by starting to ask here ("explain it to a duck"), so I thought I ...
Rich006's user avatar
  • 215
4 votes
1 answer
165 views

The documentation of the NUMERIC type states: Specifying: NUMERIC without any precision or scale creates an “unconstrained numeric” column in which numeric values of any length can be stored, up to ...
Alex R's user avatar
  • 3,309
4 votes
0 answers
157 views

I'm currently focusing on the implementation of Kyber (ML-KEM). I noticed that the AVX2 version of the compress operation seems to use a fast division algorithm. In the compress operation, we need to ...
Tall's user avatar
  • 123
1 vote
0 answers
71 views

I've been working on a fence calculation tool that breaks down a total length, as equally as possible, into components (rails and posts) using a predefined set of rail lengths. The user can choose a ...
Arnaud Hanssens's user avatar
0 votes
1 answer
97 views

I am making a game in Python where you answer math questions. I have added 3 operations: addition, subtraction and multiplication. They have 5 modes, each harder than the other. Now I want to add ...
darkphantom2709's user avatar
1 vote
1 answer
173 views

Starting to learn assembly x86-64, I'm writing a program that gets an array of integers and does some calculations on it. The purpose isn't relevant to the question, but the calculations include ...
Newlearner826's user avatar
2 votes
0 answers
90 views

I'm trying to trace this C source code (when a = 2): b = a/3; To this ARM assembly code (for unsigned 1 byte value): ldrb r2, [fp, #-6] @ zero_extendqisi2 @ tmp162, a ldr r3, .L34 @ tmp164, ...
Evan Lehr's user avatar
-2 votes
1 answer
176 views

#define BLUR 2 #define LEN (2 * BLUR + 1) * (2 * BLUR + 1) using namespace std; int main() { cout << 50 / LEN; // result is 50 } the expected result is 2 but it's 50. I try another numbers ...
reza sohrabi's user avatar
-2 votes
1 answer
57 views

i'm new to php. please i would want to get figure from user's input amount such as if a user pays 2500 i want to get 2.5 from the amount he inputed examples below 1000 ------ 1 , 1500 ------...
Tunde Adam's user avatar
0 votes
2 answers
274 views

I'm working on a problem from a Java textbook which asks to find the first 10 numbers with 50 decimal digits that are divisible by 2 or 3. Here is my code: import java.math.*; public class Divisible {...
Osmium's user avatar
  • 189
0 votes
0 answers
104 views

Hello everyone! I am a beginner writing a simple program that performs four arithmetic functions between binary numbers. Writing functions, addition, subtraction and multiplication, there were no ...
Ge0g's user avatar
  • 1
0 votes
1 answer
63 views

This code reduces a unsigned 32 bit integer into a 8bit as per our requirement. Currently this operation takes almost 2.1 mili sec to complete. Can it be optimized to complete at least under 0.9 mili ...
Sujan SM's user avatar
4 votes
2 answers
159 views

My question is about how division should be handled when you have to divide with a large power of 2, which is likely to trivial thing but I didn't find any helpful material. I am basically asking ...
Epsilon Away's user avatar
0 votes
1 answer
83 views

I have a structure (this is kinda irrelevant for my question), and in this structure, a DATE type is used. typedef div_t DATE; #define ans quot /* (s)(l)div_t : .quot -> .ans... */ #...
babipsylon's user avatar
0 votes
0 answers
81 views

mov eax,5 for: ;(future tag for loop) call Putere movsd xmm2,xmm1 div xmm2,eax movsd xmm0,xmm2 xmm1 correctly calculates a variable x raised to the power of eax. eax will be the index for a loop and ...
Catalin Ionita's user avatar
0 votes
2 answers
49 views

I'm trying to find a way to automate a simple return calculation (one cell divided by cell above it) across a large set of data which updates/adds cells regularly without having to pull-down the ...
Wheelingit's user avatar
0 votes
1 answer
44 views

i'm trying to make a division for 2 in MIPS, (i'm using PCSPIM). basically i have a number in a register ($f0), loaded. after some operations, i would like to divide this number for 2, and check if ...
MATTEO DI LORENZO's user avatar
0 votes
2 answers
84 views

I want to write a function that when given an integer, can partition it into groups of specified smaller integers. Specifically, the passed in value needs to be split into a set of values of where ...
unknownSPY'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
0 votes
1 answer
59 views

INCLUDE Irvine32.inc INCLUDELIB Irvine32.lib INCLUDELIB kernel32.lib INCLUDELIB user32.lib .data A SBYTE 10d ; A is an 8-bit signed integer B SBYTE 2d ; B is an 8-bit signed integer cc ...
Kapil Jadeja's user avatar
3 votes
1 answer
327 views

I'm familiar with compilers replacing division and modulo by a constant (e.g. x/10) with multiplication by a magic number (x * 0xcccccccd) >> (32 + 3). Compiler example here. movl $...
Kaia's user avatar
  • 909
0 votes
3 answers
722 views

ignor the barI have been experimenting with SVG recently and to be more specific on creating a 12-part wheel.I came across a code snippet in a previous post that fit my needs but consists of 6 parts ...
user23613614's user avatar
-2 votes
1 answer
303 views

I'm working on a scientific computing project that requires arbitrary precision for any real number. The way I am representing the real number approximations as two dynamic arrays of uint64_t. Each ...
BENG's user avatar
  • 161
-3 votes
4 answers
273 views

How to compute ⌊𝑥÷𝑐⌋ for a variable integer 𝑥 and a fixed-point rational number 𝑐≥1 precisely? The input 𝑥 ∈ [0, INT_MAX] is stored in a variable of type int, 𝑐 ∈ [1, INT_MAX] is given as a ...
AlMa1r's user avatar
  • 1
0 votes
0 answers
50 views

I have an assigment in which i have implemented a BinaryNumber class that has a BitList that represented the binary number as lsb first. I now want to implement a function that prints the decimal ...
Shlompi's user avatar
1 vote
1 answer
175 views

I am learning basic assembly using NASM and stumbled on an issue in the div of two numbers. Here is the code I wrote: section .data msg1 db "Enter first digit (a): ", 0 len1 equ $- ...
X_Abhishek_X's user avatar
1 vote
1 answer
1k views

I have a section of my code that needs to run millions of times. It seems that the most costly part of it is this computation: Vector2d directedInverseSquare(Vector2d &pos1, Vector2d &pos2) { ...
Malmel's user avatar
  • 37
0 votes
1 answer
159 views

Here is the code which implements binary division: Here is the function where I print the final number at the end. On Windows I get the correct answer: 60000000 7948AECA D269AE4A 6B41DD10 64209812 ...
laptop22's user avatar
0 votes
0 answers
50 views

Results = np.where( thing_minus_1 == 1, 0, (1 - thing) / (1 - thing_minus_1), ) Running this code causes a warning: RuntimeWarning: invalid value encountered in divide This is because it ...
Zac R's user avatar
  • 1
0 votes
1 answer
84 views

I have a problem, I have this code and when I run it, the code starts and tells me to enter numbers, but when I enter them, nothing happens the code is supposed to show me the elements that divided by ...
DavidTKD's user avatar
0 votes
1 answer
120 views

I have a function that finds the prime divisors of a number and returns a list of its prime factors: def prime_factors(n, listFact=[]): end = floor(sqrt(n)) if n == 1: return listFact ...
Brais Romero's user avatar
0 votes
1 answer
84 views

I am working on making a rectangle subdivision algorithm for usage with a search tree. However, the rectangles seem to "skip" every one or two vertical pixels, leaving a lot of null space. ...
slastine's user avatar
1 vote
1 answer
102 views

I'm currently trying to add an annotation to my ggplot which displays the fraction 1/9 in the specific format shown in the image I've provided. Despite it seeming like a straightforward task, I find ...
TarJae's user avatar
  • 80.2k
0 votes
1 answer
120 views

Original Question: I have downloaded Stock data with yfinance for quite a while where I add the latest data to a previous csv file not to download all data every time. As a Stock split disturb my ...
Henning's user avatar
  • 27
0 votes
0 answers
33 views

I'm relatively new here and I feel like the solution is so simple that I am just not seeing it. #GeneralTextBox02{ background: #ddd; display: inline-block; height: 100px; ...
Scholah's user avatar
  • 19
0 votes
1 answer
52 views

I am learning coding...newbie. in html: case1 I created a class inside div ` <div class="image"> <img src="./.../imageabc.jpg" alt="abc photo"/> </div>` ...
Apple-dh's user avatar
0 votes
2 answers
226 views

module test; reg [3:0]a; initial begin a= -4'b1100 / 6; $display(a); end endmodule Why is the output 8? I tried this code in EDA playground and I ...
xyz's user avatar
  • 1
1 vote
0 answers
187 views

In my CS class I am learning about hash sets and I am trying to learn Zig at the same time. I'm trying to create my own HashSet class that can hash strings, add them to an index of an array, and ...
Eric B's user avatar
  • 373
0 votes
2 answers
68 views

Given the dataset df df<-structure(list(status = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), levels = c("healthy", "rotten"...
Rudy Benetti's user avatar
1 vote
1 answer
457 views

Below are some raw data with related formular: Col A1, A2 & A3: 4, 6 & 12 Col B1, B2 & B3: 100, 150 & 120 Formular: = SUMPRODUCT(B1:B3/A1:A3) I tried to add SUBTOTAL function in ...
Micmic Chen's user avatar
1 vote
1 answer
32 views

Input table is like this: Year Region ID Value 2021 Asia 01 15 2021 Europe 02 35 2021 Asia 03 45 2022 Europe 04 49 I'm selecting entries by the year, region and id: SELECT year, region, ...
code_beginner's user avatar
0 votes
1 answer
147 views

import pandas as pd df0 = pd.DataFrame({'a': [864371.0, 864383.0, 864364.0, 864381.0, 864364.0]}) df1 = pd.DataFrame({'b': [867318.0, 867315.0, 867323.0, 867331.0, 867327.0]}) df0/df1 a b 0 ...
jjw's user avatar
  • 11
0 votes
1 answer
171 views

what is -2.4=z/-4 The division sign is meant to be a fraction. I tryed this equation on my calculator and I just cannot find the answer and this assignment is due tomorrow. Please someone help me. I ...
MCKENZIE PHILLIPS's user avatar
0 votes
1 answer
211 views

I'm running an algorithm which generates pairs (t[i], x[i]), where both t[i] and x[i] are positive doubles. They are not independent; (t[i], x[i]) depends on (t[i-1], x[i-1]). Once the algorithm has ...
0xbadf00d's user avatar
  • 18.4k
1 vote
2 answers
56 views

im trying to divide a number by 23 in flutter I expected to directly get a number back but instead i got this error The operator '/' isn't defined for the type 'String'. Try defining the operator '/'....
Mumum's user avatar
  • 13

1
2 3 4 5
46