File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
runtime/nativeMain/src/org/jetbrains/gradle/benchmarks Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,16 @@ import platform.posix.*
5
5
6
6
actual fun Double.format (precision : Int ): String {
7
7
val longPart = toLong()
8
- val fractional = this @format - longPart
8
+ val fractional = this - longPart
9
9
val thousands = longPart.toString().replace(Regex (" \\ B(?=(\\ d{3})+(?!\\ d))" ), " ," )
10
- if (fractional == 0.0 || precision == 0 )
10
+ if (fractional < DBL_EPSILON || precision == 0 )
11
11
return thousands
12
-
12
+
13
13
return memScoped {
14
14
val bytes = allocArray<ByteVar >(100 )
15
15
sprintf(bytes, " %.${precision} F" , fractional)
16
16
val fractionText = bytes.toKString()
17
- return thousands + fractionText.removePrefix(" 0" )
17
+ thousands + fractionText.removePrefix(" 0" )
18
18
}
19
19
}
20
20
You can’t perform that action at this time.
0 commit comments