« first day (31 days earlier)      last day (81 days later) » 

4:05 AM
Do you think it'd be fine if it just returned 0 for any negative non-integers as either number?
Trying to do the neat, mathematical way of finding rational powers doesn't work nearly as well with floating point as it does with rational numbers
 
4:17 AM
Time for an ADT?
 
I've been looking through some of the Jelly answers that use * operator, and in every case I've seen it's with positive integers. Honestly wondering if I should even bother handling non-integer bases
 
4:38 AM
New plan: Three operators.
Power: Takes a float as first number, and integer as second. Returns float ** integer
Root: Takes a float as first number, and integer as second. Returns float ** (1 / integer)
Rational power: Takes a float and two integers. Returns float ** (integer_1 / integer_2)
 
 
1 hour later…
5:44 AM
Wait wdym you're having difficulties with exponation?
Wdym by base?
Because it's simple
 
The second number
 
you mean b in a ^ b?
 
don't you know how indices work?
a ^ integer = a * a * ....
 
Yeah I know, it's the rational bases that are causing problems
 
5:46 AM
rational bases are easy
 
Like -64 ** (1 / 3) should be -4, but floating point can't represent thirds, making it useless.
 
a ^ (b / c) = c-root(a ^ b)
a ^ -b = 1/a^b
 
I know all the math stuff, it's just pointless to implement because it only works with multiple-of-power-of-two-denominator bases
 
that shouldn't matter though
 
That's why I'm making it only use integers, then adding an operator that takes two integers and numerator and denominator
 
5:50 AM
that seems like a yucky solution
 
So does implementing rational number bases with floating point
 
not as bad though
 
If the denominator is off by as little as one, it ruins the whole thing
So you're restricted to a tiny subset of fractions
 
just embrace the errors
05AB1E does and it's the highest ELO language
 
What error?
 
5:53 AM
the errors of floating point
 
I'm not talking about those
I'm talking about things like -64 ** (1 / 3) being NaN
Obviously it should be -4, but floating point can't handle odd denomimators (other than 1 :p), so you can't have any roots of negative numbers
 
05ab1e can't handle negative roots
Why should ash?
 
Because taking the cube root of a negative numbers seems like something that should be possible
It comes at very little cost with my proposed implementation(s)
 
6:21 AM
@RedwolfPrograms Be careful about that. APL used to support the cube root of -8 being -2 but then had to have a breaking change when complex numbers were added.
 
Wait really? Is the cube root of -8 imaginary?
Or is it just a separate number type
 
It has 3 solutions, of which one is real and two are complex.
-2 and approximately 1+1.732i and 1-1.732i
Just like the square root of 4 has a positive solution and a negative one: 2 and -2
So you probably want to chose one to return, using some kind of reasoning.
 
I don't think I'll be adding complex numbers, so I think "choose the positive one if there is one, and the negative one otherwise" should work.
 
:o Adam is here. This is really cool!
 
7:30 AM
@Lyxal ?
 
I just think you're cool
That's all
There's no joke.
 
OK, :-), I guess.
 
 
13 hours later…
8:47 PM
Should 0 ** 0 be 0 or 1?
 
9:05 PM
Supposedly IEEE 754 says 1
 
9:56 PM
When the exponents are sus: 😳
 
Huh, calculating the nth root of a number is way easier than I thought it would be
 

« first day (31 days earlier)      last day (81 days later) »