ceil Questions
5
Solved
I have two questions regarding ceil() function..
The ceil() function is implemented in C. If I use ceil(3/2), it works fine. But when I use ceil(count/2), if value of count is 3, then it gives co...
6
Solved
I'm trying to allow my program to round a number up and down respectively.
For example, if the number is 3.6, my program is suppose to round up the nearest number which is 4 and if the number is ...
7
Solved
I have a pandas series series. If I want to get the element-wise floor or ceiling, is there a built in method or do I have to write the function and use apply? I ask because the data is big so I ap...
9
I am having trouble rounding a GPA double to 2 decimal places. (ex of a GPA needed to be rounded: 3.67924) I am currently using ceil to round up, but it currently outputs it as a whole number (368)...
3
Solved
I´m looking for an alternative for the ceil() and floor() functions in C, due to I am not allowed to use these in a project.
What I have build so far is a tricky back and forth way by the use of t...
6
Solved
I've found the following macro in a utility header in our codebase:
#define CEILING(x,y) (((x) + (y) - 1) / (y))
Which (with help from this answer) I've parsed as:
// Return the smallest multip...
7
Solved
How would I manage to perform math.ceil such that a number is assigned to the next highest power of 10?
# 0.04 -> 0.1
# 0.7 -> 1
# 1.1 -> 10
# 90 -> 100
# ...
My current solution i...
7
Solved
How can I round up a CGFloat in Swift?
I've tried ceil(CDouble(myCGFloat)) but that only works on iPad Air & iPhone 5S.
When running on another simulated device I get an error saying 'NSNumber...
7
Solved
Let's imagine this datetime
>>> import datetime
>>> dt = datetime.datetime(2012, 10, 25, 17, 32, 16)
I'd like to ceil it to the next quarter of hour, in order to get
datetime....
3
Solved
8
Solved
I would say all programming languages have functions with these names to choose the lesser or greater of two values:
min() & max()
floor() & ceil() / ceiling()
And some languages have b...
5
Solved
Can somebody explain this ?
echo ceil( 20.7 * 100 ); // returns 2070
echo ceil( 2070 ); // returns 2070
all OK and logical, but
echo ceil( 40.7 * 100 ); // returns 4071
echo ceil( 4070 ); // re...
10
Solved
I know that C++ provides us with a ceil function. For practice, I was wondering how can we implement the ceil function in C++. The signature of the method is
public static int ceil(float num)
Ple...
16
Solved
How would I do something like:
ceiling(N/500)
N representing a number.
But in a linux Bash script
4
Solved
I need to floor a float number with an specific number of decimals.
So:
2.1235 with 2 decimals --> 2.12
2.1276 with 2 decimals --> 2.12 (round would give 2.13 which is not what I need)
The f...
6
Solved
I need to mimic the exact functionality of the ceil(), floor() and round() functions on bcmath numbers, I've already found a very similar question but unfortunately the answer provided isn't good e...
1
Solved
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 calc...
3
Solved
I know about math.ceil and numpy.ceil, but both of them lack of significance parameter.
For example in Excel:
=Ceiling(210.63, 0.05) -> 210.65
numpy.ceil and math.ceil in other hand:
numpy.ceil...
3
Solved
I want to calculate a simple number, and if the number is not an integer I want to round it up.
For instance, if after a calculation I get 1.2, I want to change it to 2. If the number is 3.7, I wa...
4
Solved
So I see this question has a good answer, but I want to round up no matter what, instead of rounding down no matter what. Adding 1 to it before casting int wouldn't work because it would "round" 5....
4
Solved
I want to return the least integer value greater than or equal to integer division. So I used math.ceil, but can not get the value I want.
package main
import (
"fmt"
"math"
)
func main() {
v...
15
Solved
Is there any Java function or util class which does rounding this way: func(3/2) = 2
Math.ceil() doesn't help, which by name should have done so. I am aware of BigDecimal, but don't need it.
1
Solved
I'm using Ruby 2.3.1, and here's what I want to be able to do:
1.33333333.ceil(2) -> 1.34
1.33333333.floor(3) -> 1.333
The Float#round method allows me to round, but I need to be able to s...
Sidwell asked 4/4, 2018 at 16:56
3
Solved
I have the following code:
int total = 6;
int perPage = 5;
double pages = total/perPage;
double ceilPages = Math.ceil(pages);
out.println(ceilPages);
Which outputs 1.0.
I thought it should outp...
1
Solved
The PHP docs state the following for the ceil() function:
Return Values
value rounded up to the next highest integer. The return value of ceil() is still of type float as the value range of f...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.