3 ms·
I have dreams of throttling the person who decided that operator overloading was overrated every time I work with BigInteger.
by saagarjha 7y ago
I have dreams of throttling the person who decided that operator overloading was overrated every time I work with BigInteger.
- deniscepko2 7y agoDo you have examples of real world code you had to write with BigInteger? just for amusements sake
- saagarjha 7y agoI can't seem to find the file for it, but I solved #2 on this with Java and wanted to die by the end of it: http://socalcontest.org/history/2017/SC2017ICPCProblems.pdf http://socalcontest.org/history/2017/SC2017ICPCProblems.pdf
- dtech 7y agoIt's one of the things I really like about scala, x call y is always equivalent to x.call(y) This combined with relaxed method name restrictions allow you to do "operator overloading" in quite a sane way and allow you to write bigint + 1 or set contains element. Kotlin is a bit more conservative and only translated the built-in operators to fixed methods: + to the plus method etc.
- gowld 7y agoWrite your program on ints and then transform it with sed before compiling.
- saagarjha 7y agoThat sounds significantly more difficult.
- Avshalom 7y agoThe worst part is there is a talk by Steele called Growing a Language about designing Java where specifically talks about the importance of overloading so that things like future number representations like BigInteger can be first class