Questions tagged [division]
In mathematics, division (÷) is an arithmetic elementary operation.
2,265
questions
0
votes
2
answers
22
views
numeric column operation in r with condition from another factor level
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"...
1
vote
1
answer
62
views
How to add SUBTOTAL to SUMPRODUCT with division formular in Excel?
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 ...
1
vote
1
answer
25
views
Extracting summary from selected records as a division of values
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,
...
0
votes
1
answer
30
views
Why element wise division between two dataframes with one column each result in NaN and two columns?
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 ...
0
votes
1
answer
22
views
One-Step Equations
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 ...
0
votes
1
answer
98
views
Division of large sums; deal with summation up to infinity
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 ...
1
vote
2
answers
38
views
This is a currency converter app . Why cant i divide it?
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 '/'....
-5
votes
1
answer
88
views
How can I extend my code do divide by a 64bit integer? (128bit / 64bit) [closed]
My problem is that my Code just divides the 128bit by a 32bit integer but not by a 64bit.
I know there are some instructions like _umul128() or __uint128_t for this, but I need a portable version.
The ...
0
votes
0
answers
54
views
Code Segment changing value of variable without any human interference [duplicate]
Consider the code segment below
Explanation - It performs division of two numbers n & d where size(d) <= 128 bits and 128 bits <= size(n) <= 256 bits. The data types are __uint128_t n[2], ...
1
vote
0
answers
63
views
6.3//2.1 gives 2.0. Please can someone explain? [duplicate]
I am trying to divide 2 float numbers using integer division. I am not using numpy or any other library.
Just pure python.
6.3//2.1
#output
2.0
I tried to break my problem into fractions like:
(63/...
1
vote
1
answer
42
views
uint64_t: Division with rounding
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 ...
0
votes
1
answer
36
views
In Dart language multiplying or dividing one number by another returns the wrong result. How do I avoid the error without rounding
I multiply the number 762 by the number 0.11
But the result is 83.82000000000001 (not correct)
How to avoid this number 83.82000000000001.
I want to get the correct number 83.82.
I don't want to ...
1
vote
0
answers
37
views
x64 NASM Assembly 64bit division doesn't produce remainder
mov rax, rdi
mov rbx, [_j]
idiv rbx
There was a dividend in RDI register and a divisor in the BSS section variable j. To get the calculation result of RDI % j, I wrote the code like the upper ...
0
votes
2
answers
33
views
Why is the solution to multiply rather than dividing by 10,000? [closed]
Hi I was working on Datacamp and there was a problem where you needed to find the number of homeless individuals per 10,000. I was unable to understand why the website answer only involves multiplying ...
0
votes
1
answer
66
views
(VHDL-1154) near 'std_logic_vector' ; type conversion expects one single argument
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_arith.ALL;
use ieee.math_real.all;
Use IEEE.STD_LOGIC_UNSIGNED.ALL;
port
(
signal Led_7 ...
0
votes
1
answer
71
views
how to write the correct answer in the divisions C++ [duplicate]
so the intention of the code is that it generate two random numbers between 1 and 100 for a division and i write the answer, then it tells me if its correct or not. For example 59/89 = 0.66 but says ...
-1
votes
1
answer
58
views
Division By Zero Error In Laravel Web App
I am not a programmer, and I'm trying to fix an error I'm getting in a web app I had developed recently.
It's basically a project management app, and we are importing keyword rankings from ahrefs. ...
0
votes
0
answers
13
views
ZeroDivisionError: float division by zero , i am using bias_correction package in python
I am working on rainfall data bias correction in python using bias_correction package and i am getting this error since my data is daily rainfall observed data(1970-01-01 to 2020-12-31) so there are ...
2
votes
1
answer
41
views
Does division take longer when dividing perfect factors?
I'm writing a big integer library for Swift, and am running into weird occurrences with testing my division algorithm. It seems to be correct, but when I speed test it, it runs significantly slower ...
1
vote
3
answers
63
views
pandas columns division returns multiple columns
I am trying to simply divide two columns element-wise, but for some reason this returns two columns instead of one as I would expect.
I think it has something to do with the fact that I need to create ...
0
votes
0
answers
42
views
Implement div and mod in 8Bit positive numbers
I am trying to implement division and modulo in a strictly 8-bit microcomputer via an assembly like system. The task is to get the correct result out of two unsigned 8-bit numbers A and B (B > 0) ...
0
votes
0
answers
22
views
Showing milestone percentages for each milestone while aggregating
I have a query, whose the output is the following:
Milestone
Counts
Order
Entrance
100
01
Lunch
50
02
Closings
25
03
The query is like so
SELECT CASE WHEN groupname = 'Entrance' THEN '01'
...
0
votes
3
answers
133
views
Inverse of fmod
If I have the following in C++ :
fmod(x, n) = o
how to restor x value from o ? when n value is known.
I have tried to use the normal mod where
a%b=c
if a>=b then
b+c -> a
else
c -> a
...
0
votes
0
answers
53
views
Why does dividing an integer by a float produce off-precision results? [duplicate]
I'm trying to divide an integer by a float using this simple code:
float result = 0;
int randomInt = [random integer between 100 and 500];
result = 323 / 10.00;
printf("result is: %f\n",...
0
votes
0
answers
65
views
Why would a generic function require the Copy trait when the parameters are passed in as references?
My main programming language is Java and I've just started to get into lower level languages like C/C++ and Rust. Since Java has a garbage collector, I've never really had to worry about memory ...
0
votes
0
answers
48
views
2 Digit Number inputs from user, then divide and output the quotient and remainder [duplicate]
Code below works, but only divides the first digit in the number and the output for remainder will always be zero. And division does not really work for example dividing 57/12 will return a quotient ...
1
vote
1
answer
99
views
Kotlin: FInd closest divisible
Is there function in kotlin stdlib to get closest divisible number like this:
fun closestDivisible(initialValue: Number, divisibleBy: Int)
-1
votes
2
answers
107
views
How to divide an odd number to get x integers?
If I want to divide an odd number(for example 7) with 2 to 7, and I want a list of some integers.
if I divine 7 with 4, I should get {1, 2, 2, 2}, or if I divine 5 with 3, I want to get {1, 2, 2}.
How ...
0
votes
1
answer
164
views
How do divide unsigned 128/64 Bit on x86-64?
I need to divide an unsigned 128-Bit number on a 64-Bit Processor at the Register rdx:rax with a 64-Bit divisor in rdi. The lower Bits are in raxand the higher ones in rdx.
However the DIV-Instruction ...
0
votes
1
answer
62
views
Why is dividing by double still 0, when all of the numbers are either decimal or double?
I am working on a test trading bot that connects to a centralized exchange. right now it is not actually trading but i wanted to simulate trading my making transactions fire when the price of an index ...
1
vote
0
answers
53
views
How to write a nasm file to achieve high precision division
I want to use nasm language to achieve a high precision division, firstly, I have written a C file, according which to write my assembly file.
It's the C file
#include <cstdio>
#include <...
0
votes
1
answer
134
views
How can I make Arithmetic operations (division) on label values for one Metric
I would like to use a label value in order to calculate the throughput of one file
I receive the messages on pushgateway as follow
avg_treatment_duration{"treatment_name":"A","...
0
votes
1
answer
43
views
How can I divide the number value of a key by a constant using yq?
Having an input YML (example: size in MB)
a: 2048
I want to have the output (example: size in GB):
2
But using the divide operator:
echo "a: 2048" | yq eval '.a / 1024' -
I get an error:
...
0
votes
1
answer
113
views
How to implement div(a/b) of floating point type through 1/b * a?
I need to use the transcendental function RCP(rcp(b) == 1 / b) to implement floating-point type division. I need to calculate c=rcp(b) first, and then result = c * a to get the result(a/b).However, ...
0
votes
2
answers
82
views
Precision problem when dividing Double values in Haskell
I am trying to divide a double precision floating point number (Double) by 2.0 one hundred times successively in Haskell.
When I get the value 5960464477539.06250, dividing this value by 2.00000 ...
1
vote
2
answers
56
views
Split a float in pre-determined amount that adds up together to be the float
I am looking to create a script that basically does the following:-
Split a given float into x amounts of floats (particularly into different values)
Each value must be an increment of 0.05 (eg 2.65, ...
0
votes
3
answers
90
views
how to solve this without a loop?
we're given 3 numbers y, x, and n. we're asked to find the largest k in case 1 <= k <= n and k % x = y.
for example:
input: 1 2 100
output: 99
what i can write is like:
#include <stdio.h>
...
-1
votes
1
answer
29
views
After adding bootstrap there is white line between my divs
This is my HTML code.
there was no problem with my project until i added bootstrap.
it seems the details is nt enough so iam writing this pls if u know anything pls correct my code.
<!DOCTYPE html&...
0
votes
4
answers
64
views
How to divide only a certain factor in a column in R data frame?
This is the sample dataset:
library(data.table)
df = data.table(x = c(1000,2000,10,2), y = c('A','A','B','B'))
I only want to divide df$y == "A" by 1000. The final dataset should appear as:
...
0
votes
0
answers
27
views
How can I ensure that the top container only takes up as much space as the inner elements in all conditions?
<style>
.container{
background-color: lightgray;
text-align: center;
display: inline-block;
position: relative;
border-radius:5px;
}
.itemField{
margin-top:10px;
}
.item {
margin: ...
0
votes
1
answer
58
views
Find the division remainder of a float number Python [duplicate]
Why 0.03 divide by 0.01, the reminder is 0.01, not zero??
I try 0.3 % 0.1, the result is 0.1. For 3 % 1, the result is zero. Crazy.
0
votes
0
answers
16
views
How to add a paragraph under image using div tag for all the image and para
I want to make a page by using div tags only.. So how can i make a row with for column,each column having a image and a para under it as well... How to write it?
I tried using 4 div tags under one div ...
0
votes
1
answer
61
views
PHP Fatal error: Uncaught DivisionByZeroError in working by %?
I'm testing below simple code in PHP:
`<?php
echo 5 % 0.75;
?>`
And I see error division by zero whereas 0.75 is not zero!?
what happens exactly?
0
votes
1
answer
23
views
R studio code running error in mycalc invalid operation
Error in mycalc(DF[1, 1], DF[1, 2], "multiply") : Invalid operation. Use either 'sum' or 'divide'. Help.
multiplying and dividing the value of columns
0
votes
3
answers
124
views
Dividing two numbers and printing the result and adding one to the result if there is a remainder, without using if-statements or imports or function? [duplicate]
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, ...
-1
votes
2
answers
70
views
Dividing given amount of people into same size groups with remainder forming 1 more group on top, Without using if-statements
So I am trying to figure out how to divide the given amount of people into given group sizes for example:
11 people into groups of 3, and the program giving the answer 4, since the remainder should ...
1
vote
1
answer
60
views
How to maintain decimals when dividing with numpy arrays in Python
So, I was working on implementing my own version of the Statsitical Test of Homogeneity in Python where the user would submit a list of lists and the fuction would compute the corresponding chi value.
...
-1
votes
1
answer
40
views
Dividing and Subtracting Items within a Single List
Is there a way to subtract and/or divide all items together from a single list?
i.e. subtraction:
[200,10,50,40] --> 100
i.e. division:
[200,10,2] --> 10
I've been able to use sum() and math....
0
votes
0
answers
35
views
NA values in R when dividing two variables
I have the following dataset:
structure(list(decils_renda = structure(c(1L, 3L, 5L, 3L, 2L,
10L, 3L, 7L, 2L, 8L, 4L, 7L, 6L, 2L, 5L, 1L, 1L, 9L, 4L, 2L), .Label = c("1r",
"2n", &...
-7
votes
2
answers
81
views
How to divide two entered numbers in C#? [duplicate]
`This is my second week of my first Computer Science class so I apologize for what is a very basic question:
"Design and implement a program that asks the user to enter the number of programming ...