Top "Floor" questions

A function common to many programming languages that returns the next lowest integer value by rounding the value down if necessary.

Does casting to an int after std::floor guarantee the right result?

I'd like a floor function with the syntax int floor(double x); but std::floor returns a double. Is static_…

c++ math floor
Getting the floor value of a number in SQLite?

I have a SQLite database with a table containing the scores of some league players in a bowling center. I'm …

sql sqlite floor
(int) Math.sqrt(n) much slower than (int) Math.floor(Math.sqrt(n))

I was looking at my code, hoping to improve its performance and then i saw this: int sqrt = (int) Math.…

java performance casting floor
How to math.floor to a decimal in Lua?

print(math.floor(12.5928)) The code above prints 12. What do you do to make it print 12.5?

lua floor
Why do lots of (old) programs use floor(0.5 + input) instead of round(input)?

The differences reside in the returned value giving inputs around tie-breaking I believe, such as this code: int main() { std::…

c++ rounding floor
How do I create a new Joda DateTime truncated to the last hour?

I am pulling timestamps from a file that I want to create a new DateTime for, but I want to …

java datetime truncate jodatime floor
How to ceil, floor and round bcmath numbers?

I need to mimic the exact functionality of the ceil(), floor() and round() functions on bcmath numbers, I've already found …

php rounding floor bcmath ceil
Avoiding Calls to floor()

I am working on a piece of code where I need to deal with uvs (2D texture coordinates) that are …

c++ optimization graphics 3d floor
I stuck on android method FloatMath.floor API does not issue

Method: @Override protected boolean isReadyForPullEnd() { @SuppressWarnings("deprecation") float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight …

android android-studio window floor
Write your own implementation of math's floor function, C

I was thinking about the floor function available in math.h. It is very easy to use it: #include <…

c math floor