@asedunov asedunov released this Aug 9, 2017 · 1 commit to 1.2-M2 since this release

Assets 3

Compiler

Breaking change: Java-default method calls

Kotlin interface members overriding Java-default methods while targeting JVM 1.6 now produce an error on super calls requiring to be compiled with -jvm-target 1.8 option

Standard library

Revised windowed/pairwise operations

  • windowed function now has its step parameter defaulting to 1.
    It also gets an additional optional parameter partialWindows, which controls what to do with incomplete windows in the end. By default it is false, which means incomplete windows are dropped.
  • pairwise function name was too confusing, it was unclear how it paired the elements together. Now it is called zipWithNext, so it is more clear that each element is zipped with the next element in a collection.

Common math operations in the standard library

There was a longstanding request to support math operations in the standard library KT-4900. Until now one had to resort to math functions and constants from java.lang.Math class in JVM platform and to kotlin.js.Math which exposed native JS Math functions to Kotlin code in JS platform.
But now we're introducing the following groups of API in the kotlin.math package:

  • constants: PI and E;
  • trigonometric: cos, sin, tan and inverse of them: acos, asin, atan, atan2;
  • hyperbolic: cosh, sinh, tahn;
  • exponentation: pow (an extension function), sqrt, hypot, exp, expm1;
  • logarithms: log, log2, log10, ln, ln1p;
  • rounding:
    - ceil, floor, truncate, round (half to even) functions;
    - roundToInt, roundToLong (half to integer) extension functions;
  • sign and absolute value:
    - abs and sign functions;
    - absoluteValue and sign extension properties;
    - withSign extension function;
  • max and min of two values;
  • binary representation:
    - ulp extension property;
    - nextUp, nextDown, nextTowards extension functions;
    - toBits, toRawBits, Double.fromBits (these are in the kotlin package).

Previous releases

This release also includes fixes and improvements from 1.2-M1 and 1.1.4-eap-54 releases