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?
>>8771694
Yes, floor(x) is a simple fiction using basic math and only x
>>8771694
ceiling(x-1)
:^)
>>8771699
Using * / + - ^ etc. how would one do that?
f(n) = n - (n mod 1)
But that probably doesn't count for you.
>>8771707
Can't be done without logarithms
>>8771694
f(x) = x - (x % 1)
>>8771709
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.
>>8771711
Can do those by using ^
How do I do it with logarithms?
There's this but it's an infinite series and uses sin
https://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)+...
>>8771742
can you make sin into it's basic formula too please?
Only +-*/^()
>>8771753
no that's dumb
>>8771753
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
>>8771753
Change it to polynomial basis
>>8771762
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.
>>8771785
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)
>>8771795
>absurdly more complicated
I'm in
>>8771707
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.
>>8771694
Sure. [math]f(x) = \lfloor{x} \rfloor[/math]
>>8771705
not if x is already an integer you fucking stupid homophobic slur
>>8772211
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.
>>8772292
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.