karelpeeters
09/26/2017, 12:06 PMDouble
has a higher max value than Int
?ilya.gorbunov
09/26/2017, 12:12 PMNaN
, POSITIVE_INFINITY
etc, cannot be represented as Int, even after rounding.gaetan
09/26/2017, 12:12 PMDeactivated User
09/28/2017, 10:18 AMfun Int.reinterpretAsFloat(): Float = java.lang.Float.intBitsToFloat(this)
fun Float.reinterpretAsInt(): Int = java.lang.Float.floatToIntBits(this)
fun Long.reinterpretAsDouble(): Double = java.lang.Double.longBitsToDouble(this)
fun Double.reinterpretAsLong(): Long = java.lang.Double.doubleToLongBits(this)
They are useful for binary serialization and for some floating point hacks/introspection.
As far as I know it has been already implemented but with different API. Using toBits and Companion.fromBits to both Float and Double. Not sure which one is better. But I wanted to suggest this anyway :)trevjones
09/28/2017, 9:05 PM.toMultimap
operator that takes a key selector function. is there a kotlin stdlib equivalent?jw
09/28/2017, 9:20 PMgroupBy
trevjones
09/28/2017, 9:20 PMgaetan
09/29/2017, 8:10 AMlog(double, double)
function which is a generic version of log
allowing to call log with any base. In real life, I think that the 3 classical logs (natural, base 10, base 2) are enough for 99,9% of uses. By introducing this function, you change the conventions of having log representing the natural log, replacing it by ln(double)
. Even, if it’s more correct I’m not sure that kotlin have to fix java and javascript. If someone need the generic version of log he could implement it in his code.beholder
09/30/2017, 11:52 AMdmcg
09/30/2017, 12:59 PMList.map
? If not, why not, given the performance that could be gained?kirillrakhman
09/30/2017, 1:11 PMdmcg
09/30/2017, 1:19 PMdmcg
09/30/2017, 1:43 PMdmcg
10/01/2017, 1:36 PMdmcg
10/01/2017, 9:34 PMjw
10/09/2017, 4:26 PMjw
10/09/2017, 4:26 PMdata class Names(val names: List<String>)
karelpeeters
10/09/2017, 4:28 PMjw
10/09/2017, 4:28 PMjw
10/09/2017, 4:33 PMorangy
jw
10/09/2017, 4:51 PMorangy
jw
10/09/2017, 4:54 PMval foo: String, val bars: List<String>, val baz: String
so I have compareBy(MyType::foo).thenComparing(MyType::bars, bigCustomIterableCompratorFactory()).thenBy(MyType::baz)
jw
10/09/2017, 4:54 PMbigCustomIterableCompratorFactory
function or maybe some way of specifying that I want that property compared by its iterable valuesjw
10/09/2017, 4:57 PMkarelpeeters
10/09/2017, 4:58 PMcomparators.kt
nor defined on the List
or Iterable
interfaces it probably just doesn't exist.jw
10/09/2017, 5:00 PMjw
10/09/2017, 5:00 PM