[K/N] Internalize FloatingPointParser
As a part of efforts to stabilize K/N stdlib.
This commit is contained in:
@@ -53,7 +53,7 @@ private external fun parseFloatImpl(s: String, e: Int): Float
|
||||
* Used to parse a string and return either a single or double precision
|
||||
* floating point number.
|
||||
*/
|
||||
object FloatingPointParser {
|
||||
internal object FloatingPointParser {
|
||||
/*
|
||||
* All number with exponent larger than MAX_EXP can be treated as infinity.
|
||||
* All number with exponent smaller than MIN_EXP can be treated as zero.
|
||||
|
||||
@@ -137,16 +137,14 @@ public actual inline fun String.toLong(radix: Int): Long = toLongOrNull(radix) ?
|
||||
* Parses the string as a [Float] number and returns the result.
|
||||
* @throws NumberFormatException if the string is not a valid representation of a number.
|
||||
*/
|
||||
@kotlin.internal.InlineOnly
|
||||
public actual inline fun String.toFloat(): Float = FloatingPointParser.parseFloat(this)
|
||||
public actual fun String.toFloat(): Float = FloatingPointParser.parseFloat(this)
|
||||
|
||||
|
||||
/**
|
||||
* Parses the string as a [Double] number and returns the result.
|
||||
* @throws NumberFormatException if the string is not a valid representation of a number.
|
||||
*/
|
||||
@kotlin.internal.InlineOnly
|
||||
public actual inline fun String.toDouble(): Double = FloatingPointParser.parseDouble(this)
|
||||
public actual fun String.toDouble(): Double = FloatingPointParser.parseDouble(this)
|
||||
|
||||
/**
|
||||
* Parses the string as a [Float] number and returns the result
|
||||
|
||||
Reference in New Issue
Block a user