« first day (157 days earlier)      last day (1621 days later) » 

7:47 AM
@Leo I pushed base conversion. For a positive integer base, the first digit is negative if the input is, and the last digit is a float if the input is. Fractional and negative bases are weirder, but they work too. Base 0 just wraps the input in a list for now.
The commands are B for arbitrary base, d for decimal and for binary.
The same command does conversion to/from a base.
 
Leo
8:33 AM
@Zgarb Wow, that seems perfect! Good idea with the builtin for binary conversion, I wouldn't have thought about that
 
9:26 AM
@Zgarb I'm still not sure how that's a useful behaviour
 
10:06 AM
@MartinEnder It seems mathematically cleaner to me, if you think what happens when you remove the first "digit" in the base b representation of n. In the scheme where negative numbers have all digits negative, this means you get rem n (b^k) for some k (in Haskell syntax), and in the scheme where the first digit is negative, you get mod n (b^k). And mod is nicer than rem.
It may not be useful in any way though.
 
actually, you get neither rem nor mod if you only have one negative digit
consider -11 base 10
in your scheme it's [-1, 1]
take away the first digit you end up with 1 which is neither mod (which would be 9) nor rem (which would be -1)
 
No, it's [-2,9].
 
ohhh, I see
alright, that makes sense then
now I also get what you were on about with 2's complement
yeah, I actually quite like that, especially because negating all elements can be implemented more easily manually
 
A nice thing about this scheme is that it's really easy to implement, and the implementation works for negative and fractional bases as well. Although I'm not entirely sure how canonical the outputs are in those cases...
Bases 1, -1 and 0 are still special cases though.
 
is it even necessary for negative bases? I thought for negative bases, you can represent all integers using only non-negative digits
 
10:21 AM
Hmm, that's true. My implementation spits out all negative digits...
It "works" in the sense that taking antibase of the result gives the original.
Maybe it should produce only nonnegative digits.
 
10:51 AM
There, now it does.
 
 
3 hours later…
Leo
1:56 PM
I should wait until I can test it myself but I'm curious: what happens with fractional bases less than 1?
 
2:30 PM
@Leo Apparently it goes to an infinite loop.
Maybe it should do something else...
BTW, I pushed some arithmetic functions.
 
 
3 hours later…
Leo
5:18 PM
@Zgarb they could focus on encoding the fractional part of a number. E.g. 123.456 in base 0.1 would be [6,5,4,123] (which if i'm not mistaken can be converted back to the original number in the usual way). I think this would need an entirely new special case in the implementation, though
@Zgarb nice, I like how you implemented pow and sqrt :)
Amorphous numbers are quite a beautiful thing
 
5:44 PM
power was the main reason I started thinking about amorphous numbers. With many numeric types it would've been really inconvenient.
 

« first day (157 days earlier)      last day (1621 days later) »