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

I have a number represented as a large binary string (length can be up to 1 million bits). The number is recursively split as follows: At each step, divide the number x into two parts: floor(x/2) and ...
md emon6767's user avatar
0 votes
0 answers
43 views

I'm trying to use the ceiling function in report builder power bi but it gives error each time I run the report.. and I get below error: The 'Value' expression for the field 'Sheet1_Budget2' contains ...
Sam_UAE's user avatar
  • 21
1 vote
0 answers
104 views

I need to round off each decimal values to its nearest whole number, anything less than 0.4 to be rounded off to 0, and 0.5 and above to be rounded off to 1. But when i try that in C++ no matter which ...
Kevin Jonathan's user avatar
0 votes
1 answer
60 views

I don't get why the height of a segment tree is O(logn). https://dzone.com/articles/binary-trees-part-1 Based on the article above, the maximum height of a full binary tree with n nodes is (n-1)/2 (-&...
khlrrr's user avatar
  • 1
0 votes
1 answer
166 views

I had this C++ code: int x; double y; // do sth int z = ceil(x*y); If x = 410, y = 1.1, then z = 452 when it should've been 451. I changed to z = ceil(float(x*y)) and it works. My friend suggests z ...
Le_Square's user avatar
0 votes
1 answer
90 views

This is the program I wrote to find ceiling and floor of a Number. public class BinarySearchAlgorithm { public static void main(String[] args) { int[] arr = {10, 9, 8, 7, 4, 3, 2, 1}; ...
Rushan Shaikh's user avatar
1 vote
1 answer
87 views

I am working with a dataframe in pandas. In this dataframe there is a column which type is datetime. It represents the moment in which a product is sold, other columns indicate the price, the type, ...
slow_learner's user avatar
2 votes
1 answer
298 views

EDIT: To rephrase this question, how do I avoid truncation when assigning a double value to an int variable that displays and rounds up said value using ceil? Without changing their declaration, if ...
Loading Screen's user avatar
-1 votes
1 answer
72 views

I have a vector of fractions a = [0.04352034965262487, 0.480655360084497, 0.02655889003246612, 0.449265400230412, 0.0] of type float64 such that of course sum(a)=1. These fractions represent ...
zdm's user avatar
  • 531
0 votes
1 answer
168 views

I am trying to find the the ceil of a variable which was been assigned a value but when I pass the function ceil("variable name") it throws an error. #include <stdio.h> #include <...
Harshit Singh's user avatar
1 vote
1 answer
355 views

Here's a very basic issue that i cannot resolve on my mind: In JS if i do: Math.random() i will get random numbers between 0 and 1 (including 0, not including 1) So, if i do Math.ceil(Math.random() * ...
lezammm's user avatar
  • 23
-1 votes
1 answer
72 views

I am solving problem 1A : Theatre Square(https://codeforces.com/problemset/problem/1/A) on Codeforces. Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters....
tarungaur's user avatar
1 vote
1 answer
355 views

I would like to implement a function very similar to the floor function, but instead of rounding towards the nearest integer, I would like it to round any number(s) according to a specified array, and ...
Yash's user avatar
  • 21
0 votes
1 answer
103 views

CEILING in Excel =CEILING(E2,6)/60 for calculating legal billable hours in 6 min increments from minutes (1 min = 0.1, 5 min = 0.1, 7 min = 0.2 etc) when transposed to JS with the CEIL function as: ...
DJLConsulting's user avatar
1 vote
2 answers
362 views

Here is the code I am using to plot graph of ceiling function in python. import math import numpy as np import matplotlib.pyplot as plt x = np.arange(-5, 5, 0.01) y = np.ceil(x) plt.plot(x,y) plt....
avni prajapati's user avatar
2 votes
2 answers
143 views

say I have a date range from start to end where start <- as.Date(2009-11-05), end <- as.Date(2009-12-17). I want a function that essentially acts as a customized floor/ceiling and returns a date ...
Algebro1000's user avatar
0 votes
0 answers
75 views

I have this script: function round_price_with_limits( $price = null, $multiplier = 9.3, $nearest = 10, $minus = 0.05, $map = 9.95, $msrp = 9999999999) { // Ensure a price was provided. if ( !...
prokops's user avatar
  • 45
0 votes
0 answers
23 views

I use my own data type in Eigen lib by template,and I realize +-*/ overload , but Eigen use std::ceil() function, I don't know how to overload this. thanks for every suggestion. just tell me How to ...
liu Yi's user avatar
  • 1
2 votes
2 answers
715 views

When I execute this code the value of ans1, ans2 is 50002896 and 50005000. I know there is some issues with ceil function but was not able to figure out the exact cause. #include <bits/stdc++.h> ...
Chinnmay B S's user avatar
-2 votes
1 answer
178 views

Default ceiling doesn't work this way. Ceil should work in this way - Example 2 - 3.1, 4.5, 5.9 after ceiling - 3.5, 4.5, 6
nitinkhatri749's user avatar
0 votes
0 answers
57 views

Essentially the query works like this: Select Sum(Ceiling((Exp_Cart)*Exp_Qty) from Table_X where Item in ('3') I am receiving an error in my query and wondering if there is a better way to approach ...
Trish Janzen's user avatar
-3 votes
1 answer
488 views

a. In variables a,b gets the input from the user so as to evaluate the expression from the given input and it gives the ceil and floor values as the output. def ceil_flooor(): a = float(input()) ...
June's user avatar
  • 25
1 vote
2 answers
609 views

Given that Math.ceil(1/3) yields 1, how do I get that 1 (or 1n) from BigInt input values of 1n and 3n? Obviously Math.ceil(Number(1n)/Number(3n)) would work but some bigints might be too big for that ...
Pete Lomax's user avatar
-1 votes
1 answer
314 views

The following code is giving me a wrong answer and I can't understand why. int x = 10; int y = 15; System.out.println((int)Math.ceil(x/y)); Result: 0 I was expecting a 1 as the answer.
Isaac Dzikum's user avatar
0 votes
2 answers
224 views

ceil() in the constraint Hello, I am studying a published paper. One of the constraints from this paper(which can be shown in the link) requires the ceil() function. We can use the ceil() function at ...
Tunahan Bilgiç's user avatar
0 votes
2 answers
647 views

In round function we can use (4,512,1) but the same is not true for ceil and floor. I want to ceil and my floor the value 4,512 as 4,5 and 4,6 but the decimal point 1 is not always constant. it may ...
DataGeek's user avatar
1 vote
1 answer
173 views

(Followup question for Compile-time ceiling function, for literals, in C?) Considering the following CUDA function: __device__ int foo_f() { return ceilf(1007.1111); } It should be easy to optimize ...
einpoklum's user avatar
  • 138k
2 votes
2 answers
631 views

I have a C program which involves some floating-point literal that's defined by a macro. And - it just so happens that in a performance-critical part of the code, I need the ceiling of that floating-...
einpoklum's user avatar
  • 138k
0 votes
1 answer
311 views

i would like to round the last 3 digits of the float number 169786.122 and leaving only 3 digits is it possible to do it with the math.h library and the ceil function? in case of 169786.122 == 170 in ...
user avatar
0 votes
0 answers
25 views

Sorry for the maybe stupid question. I wanted to write a straightforward c++ code that takes the number of people and returns how many baking trays of 12 muffins I have to bake when everyone gets two ...
buttercup's user avatar
3 votes
1 answer
1k views

I'm wishing to round up a float variable to two decimal places regardless of what the float is. My current code is shown below: void MainMethods::convert(float& floatValue, string numericString) {...
RadioCode345's user avatar
0 votes
2 answers
2k views

I have created oracle NVL function which would subtract start and end time column and give the result However I am not getting correct output value Example Start time- 2:33:10 End time -2:33:20 ...
Tejas Mehta's user avatar
1 vote
1 answer
133 views

I am hoping for below outcomes : If Input => 25.69 - OutCome should be 25.6 If Input => -0.40 - OutCome should be -0.4 If Input => -0.004 - OutCome should be 0 or 0.0 To achive this I have ...
Jaimin Modi's user avatar
  • 1,707
1 vote
1 answer
431 views

How can we apply excel ceiling function with significance value in SQL server ? =Ceiling(10,3) it should return 12, because 12 is roundup nearest to 3 =Ceiling(36,7) it should return 42, because ...
Asfan's user avatar
  • 11
2 votes
1 answer
474 views

by performing the following calculation p=math.ceil(57050*1.12) I am receiving 63897. However other tools (such as Excel) deliver 63896. I need to use ceil (round up), because the procedure is part ...
ZetDen's user avatar
  • 167
0 votes
1 answer
113 views

When I use 0.0 + in Math.ceil() method in below code, the answer with op=1 and cl=11 is 7 which is correct. (int)(Math.ceil((0.0 + op) / 2) + Math.ceil((0.0 + cl) / 2)) But when I don't use 0.0 + ...
AYUSHI TYAGI's user avatar
0 votes
1 answer
649 views

When trying to round a decimal point value (a float) to an integer, what is the actual difference between the round, math.floor and math.ceil functions in python?
Felipe D.'s user avatar
  • 1,301
0 votes
1 answer
444 views

I would like to write a specif rounding logic. number = x if x < 950: # round number to and in steps of 50 elif x < 9000: # round number to and in steps of 100 elif x < 100000: # ...
exec85's user avatar
  • 497
0 votes
1 answer
559 views

How to get days count from CURRENT_TIMESTAMP without considering time (hours,minutes,seconds). for eg. CURRENT_TIMESTAMP is 24-JUN-21 00.01.01 AM and EVENT_TIMESTAMP is 23-JUN-21 07.00.00 PM then it ...
2787184's user avatar
  • 3,921
0 votes
1 answer
59 views

I have a number and i need to get the closest 1000th value. Both upper side and lower side along with the difference between numbers so that i can give weightage. Example: Number_1 = 25460 Expected ...
Madan Raj's user avatar
  • 326
0 votes
1 answer
152 views

Could someone please explain why R has a problem with rounding/ceiling and how you can make sure that it calculates correctly? N = 50e3 x = vector(length = N) p = 0.995 ceiling(length(x)*(1-p)) 251 ...
Sina Mozayyan's user avatar
2 votes
1 answer
371 views

Perl already links to libm. $ ldd $(which perl) ... libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd8ce2ea000) ... So if Perl already links to libm, why aren't often used ...
Evan Carroll's user avatar
0 votes
1 answer
250 views

Sql newbie here, Im stuck on a problem. I have a recipe ingredient table, and basically what I want to do is find the price of a recipe rounded up to whole ingredients. So I wrote this sql. select ...
Hermii's user avatar
  • 11
8 votes
1 answer
3k views

Why don't ceil() and floor() return an integer? How can I return an integer? a = 10 b = 3 typeof(a/b) ## Float64 c = ceil(a/b) typeof(c) ## Float64 This issue bothered me in the context of ...
PatrickT's user avatar
  • 10.6k
0 votes
1 answer
613 views

I have created vectors for months and month numbers, then for months 6-9, and from there, the mean... mean(Summer) Months[mean(Summmer)] July Now I have to use floor and ceiling functions to return ...
Olivia Caridi's user avatar
-1 votes
2 answers
41 views

#include<bits/stdc++.h> using namespace std; int main() { int ans = ceil(1.5); printf("%d\n", ans); ans = ceil(3 / 2); printf("%d", ans); } Output: 2 1 ...
Al-amin Chowdhury's user avatar
0 votes
1 answer
455 views

Why does np.ceil give me different answers for what should equivalent expressions? np.ceil(336) Out[34]: 336.0 np.ceil(100*(2.85+0.43+.08)) Out[35]: 337.0
Susana Rodriguez's user avatar
2 votes
3 answers
723 views

Is there a way to round always up to the next tens? E.g., 0.000000000003 shall become 0.1. 0.1244593249234 shall become 0.2 and 0.9x shall become 1. Negative numbers are not a thing here. Is there a ...
newbypyth's user avatar
  • 131
0 votes
0 answers
32 views

I want to round number 5.53 always like this: 5.55 in PHP ? Any idea?
Konstantini's user avatar
1 vote
1 answer
998 views

Example: I have problem with table header. How can i remove this white border or change color of it? My code: JTableHeader header = table.getTableHeader(); header.setBackground(new Color(21, 25, ...
user avatar

1
2 3 4 5
7