Commit Graph

58 Commits

Author SHA1 Message Date
Abduqodiri Qurbonzoda 846a7823ad Introduce minOrNull and maxOrNull extension functions #KT-39064 2020-06-19 04:53:49 +03:00
Ilya Gorbunov b4ba00ca36 Document and test NaN propagation of maxOf/minOf
Also simplify minOf/maxOf implementations

#KT-38708
2020-06-02 19:01:44 +03:00
Ilya Gorbunov a225842f9b Test that known Floats can fit in FloatArray without over/underflow
But some precision loss can still happen in JS.

Relates to KT-24975
2020-04-02 04:04:04 +03:00
Ilya Gorbunov d88d2cb058 Test new Double/Float constants
Split test expectations based on actual support of enforced Float range

KT-29182, KT-13887
2020-04-02 04:04:04 +03:00
Abduqodiri Qurbonzoda 1f721796b8 Add vararg overloads for maxOf/minOf functions #KT-33906 2020-02-26 04:17:19 +03:00
Ilya Gorbunov bbdbc2896b Workaround in FloatMathTest.powers to avoid failures with js-ir runtime
Include kotlin-stdlib-js-ir in local core libs build/test and
enable failing build on test failures.

Relates to: KT-24975
2019-10-16 17:48:47 +03:00
Abduqodiri Qurbonzoda 01a613dca4 Add tests for floating-point to integral conversion 2019-08-15 00:57:27 +03:00
Ilya Gorbunov f8724654a1 Bit query and bit rotation functions for Int, Long, Short, Byte
#KT-12749
2019-07-08 19:09:32 +03:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Pavel Punegov f543170998 Increase tolerance for Float asin test 2018-10-10 19:05:44 +03:00
Alexander Udalov 55c8b35eee Remove unneeded default imports in stdlib and tests 2018-10-01 13:39:02 +02:00
Ilya Gorbunov 8f6d2b70a9 Add stdlib test for Boolean companion 2018-08-30 14:55:48 +03:00
Ilya Gorbunov 5f3a7f0147 Use Char.MIN_VALUE and MAX_VALUE in tests 2018-08-30 14:55:45 +03:00
Ilya Gorbunov 92e149fa40 Add tests for SIZE_BYTES and SIZE_BITS constants
#KT-8247 Fixed
2018-08-30 14:55:43 +03:00
Ilya Gorbunov cbc3480d9e Split common builtin companion tests from JVM-only tests
Remove duplicated tests from NumbersJVMTest.
2018-07-03 19:58:53 +03:00
Ilya Gorbunov ecf0d7ec0d Reformat stdlib tests and samples
#KT-5558
2018-04-27 05:28:57 +03:00
Ilya Gorbunov e21c235bbb Add or update copyrights in the standard library sources 2018-04-26 21:57:50 +03:00
Ilya Gorbunov 9b38e5e7b5 stdlib tests: move JVM-only test source files 2018-04-12 17:53:00 +03:00
Anton Bannykh ed80252ba8 JS: fix double compareTo behaviour for NaN and +-0 (KT-22723) 2018-02-28 15:01:58 +03:00
Ilya Gorbunov 20b122c1dd Use kotlin.test.Test instead of org.junit.Test in common stdlib tests
(and in jvm-only and js-only tests also)
2017-10-15 17:40:53 +03:00
Ilya Gorbunov 0454bd9e28 Detect endianness when reinterpreting Float64 as two Int32
#KT-18264

Use Int32Array instead of Uint32Array since ints are required to be singed.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov aa3bfc55c3 Implement in JS nextUp(), nextDown(), nextTowards() and ulp extensions
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 480d4a0093 Make withSign(NaN) behave as in JVM
#KT-4900

Where only the sign of the result is undefined, but the absolute value is unchanged.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 132f2f88c2 Provide Double and Float bit conversion functions as extensions in JS and Common
Instance extension: Double/Float.toBits/toRawBits
Companion extension: Double/Float.Companion.fromBits

#KT-18264 Fixed
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 044ccf1532 Introduce inverse hyperbolic functions
#KT-4900

Improve accuracy of JS polyfills of hyperbolic functions and expm1/log1p
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 86b23ffe49 Integer math functions and tests for them
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov a832db48f6 Float Math API
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov f3ea499d2c JVM-specific math functions and tests
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 7e48f8b180 Provide Double and Float bit conversion functions as extensions
Instance extension: Double/Float.toBits/toRawBits
Companion extension: Double/Float.Companion.fromBits

 #KT-18264 Fixed
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 6373ac7ef0 Rename log to ln, log1p to ln1p, keep pow only as extension
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 805d1c90b7 Rename sgn to sign, add docs and tests
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov d0b12e3872 Use HALF_EVEN rounding mode for round()
Add docs and tests for rounding.

 #KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov 5e9e6d5951 Common math tests and document for trigonometric functions and powers.
#KT-4900
2017-10-11 19:20:24 +03:00
Ilya Gorbunov c2cee2e405 Update binary api dump, rearrage bignumbers tests 2017-10-11 19:20:24 +03:00
Ilya Gorbunov b89e5b2708 Add missing api: radix overloads, mathContext and scale overloads, orNull overloads
Move string-to-number conversions and their tests near to existing ones

Add documentation and copyrights.
2017-10-11 19:20:24 +03:00
voddan e86e080088 KEEP-49: extending Kotlin API for BigInteger and BigDecimal 2017-10-11 19:20:24 +03:00
Ilya Gorbunov 6ae19e03d5 Clean warnings and refactor stdlib tests.
Merge RangeJVMTest into RangeTest.
2017-04-18 18:51:20 +03:00
Ilya Gorbunov 897e9658ac Do not run total order tests on JS 2017-01-11 14:45:19 +03:00
Ilya Gorbunov 74331f8eaa Add NaN propagation and total ordering tests. 2017-01-11 14:45:16 +03:00
Ilya Gorbunov c43e4f6682 Uncomment some assertions for overflow behavior that now can pass in JS 2016-12-23 18:14:32 +03:00
Mikhail Zarechenskiy c15c00677e Add operator 'rem' as extension to BigDecimal
Deprecate 'mod' operator
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy 5a829809d9 Add operator 'rem' as extension to BigInteger
#KT-14650 Fixed

 Note that after this change behaviour of '%' on BigInteger is changed,
now it works like a proper remainder
2016-12-14 15:29:00 +03:00
Ilya Gorbunov 6a70761783 Minor: normalize '@Test' annotation casing in all tests. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov badbcd08de Annotate explicitly stdlib tests, which must be excluded from JS stdlib tests with @JvmVersion, do not use file naming convention, use preprocessor instead. 2016-10-26 17:47:15 +03:00
Ilya Gorbunov c5a208f3eb Rearrange stdlib unit tests across packages.
Rearrange JS stdlib unit tests.
2016-06-18 16:50:32 +03:00
Ilya Gorbunov 6c7cefaae3 Use HALF_EVEN rounding mode by default for BigDecimal division operator.
#KT-10462 Fixed
2016-02-09 22:51:02 +03:00
Ilya Gorbunov a78b08d9c7 Use generic coerceIn for nullable primitives, provide specialization for non-nullable ones.
Fix docs for coerceAtMost.
2016-01-24 06:44:13 +03:00
Ilya Gorbunov de11ed4fc6 Primitive Companion objects do not longer implement IntegerConstants and FloatingPointConstants. All declarations moved inside companions.
IntegerConstants and FloatingPointConstants are dropped.
#KT-8897 Fixed
2015-12-24 06:17:03 +03:00
Yan Zhulanow 9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Ilya Gorbunov 794819cea2 StdLib cleanup: make calls non-infix 2015-11-21 00:54:10 +03:00