Is there a math formula which rounds down(floors) a number by simply using the number itself and basic math...

Is there a math formula which rounds down(floors) a number by simply using the number itself and basic math? By example: f(1,5)=1. Can we floor the number by only using the number itself and not picking out its decimal?

Other urls found in this thread:

en.wikipedia.org/wiki/Floor_and_ceiling_functions#Continuity_and_series_expansions
twitter.com/NSFWRedditVideo

no

Yes, floor(x) is a simple fiction using basic math and only x

ceiling(x-1)

:^)

Using * / + - ^ etc. how would one do that?

f(n) = n - (n mod 1)
But that probably doesn't count for you.

Can't be done without logarithms

f(x) = x - (x % 1)

Sorry, you need to use ceil or floor for that and I don't know how to do those with "classic" math :/
Thanks for the try thought

Number - (number modulo 1).

Unless you meant in programming. In which case, just cast that shit to int.

Can do those by using ^
How do I do it with logarithms?

There's this but it's an infinite series and uses sin
en.wikipedia.org/wiki/Floor_and_ceiling_functions#Continuity_and_series_expansions

Step aside brainlettos, I got this

x-1/2+sin(2pi*x)/pi+sin(4pi*x)/(2pi)+sin(6pi*x)/(3pi)+...

can you make sin into it's basic formula too please?
Only +-*/^()

no that's dumb

not the guy but sin is also an infinite sum so you'll have infinite sums in an infinite sum and thats not rly cool

Change it to polynomial basis

That's sort of the point of it really, I'm trying to make a rediculousily long mathematical formula instead of default coding in a code I'm making.
So far I've got a replacement for if(a == a1 or b == b1 or c == c1...).
Now I'm trying to input many numbers as one, using 1,2453 as 1*2+4*5+3 etc.
Which is why it would be nice if it was completly basic math.

There's nothing you can do that isn't going to be absurdly more complicated than just solving it the natural way (either using the built-in function or if you aren't allowed for some reason just truncating the decimal)

>absurdly more complicated
I'm in

are you retarded?
*/+-^ are all continuous except at 0, so to make a floor function with discontinuities at every integer is impossible. The best you can do is an infinite sum using those operations in there somewhere.

Sure. [math]f(x) = \lfloor{x} \rfloor[/math]

not if x is already an integer you fucking stupid homophobic slur

What if the function maps from reals to the irrationals?

If you get a decimal number, multiply by powers of 10 to get an integer.
Then round that down to the nearest x where x is the power of 10 you used.
Finally, divide that number by 10^x to get your number.

Sorry, what I mean is if you have f(2) = 1.3,

Then multiply 1.3 by 10 to get 13.
Round 13 to the nearest 10, which is 10.
Divide 10 by 10 to get an answer of 1.