Top "Floor" questions

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

Taking the floor of a float

I have found two ways of taking floors in Python: 3.1415 // 1 and import math math.floor(3.1415) The problem with the first …

python python-3.x math floor
Floor or ceiling of a pandas series in python?

I have a pandas series series. If I want to get the element-wise floor or ceiling, is there a built …

python pandas series floor ceil
C integer division and floor

In C, is there a difference between integer division a/b and floor(a/b) where both a and b …

c integer division integer-division floor
Round minute down to nearest quarter hour

I need to round times down to the nearest quarter hour in PHP. The times are being pulled from a …

php date time floor
Math.round() and Math.floor() problem with setInterval()

I'm having problem with Math.round() and Math.floor() in setInterval() function by using jQuery. This is my code: var …

jquery math setinterval rounding floor
Why does Math.Floor(Double) return a value of type Double?

I need to get the left hand side integer value from a decimal or double. For Ex: I need to …

c# math floor
What's the difference between the pair of functions floor()/ceil() and min()/max()?

I would say all programming languages have functions with these names to choose the lesser or greater of two values: …

max min floor ceil
Rounding to nearest fraction (half, quarter, etc.)

So, I need to create the following functions but my head can't think of any possibility in PHP without complicated …

php rounding printf floor ceil
Ruby .ceil and .floor

I'm new to Ruby and I'm trying to figure out how ceil and floor works as I get different answers …

ruby math floor ceil
Why would I combine Math.floor with Math.random?

Why would anybody call Math.floor on a Math.random result? I've seen it used like: Math.floor(Math.random() * …

javascript math random floor