You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jsoniter-scala-core/js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonWriter.scala
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2514,9 +2514,10 @@ final class JsonWriter private[jsoniter_scala](
2514
2514
// "The Schubfach way to render doubles": https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view
2515
2515
// Sources with the license are here: https://github.com/c4f7fcce9cb06515/Schubfach/blob/3c92d3c9b1fead540616c918cdfef432bca53dfa/todec/src/math/FloatToDecimal.java
2516
2516
private[this] defwriteFloat(x: Float):Unit= {
2517
+
valbits= java.lang.Float.floatToIntBits(x)
2517
2518
varpos= ensureBufCapacity(15)
2518
2519
valbuf=this.buf
2519
-
if (x<0.0f) {
2520
+
if (bits<0) {
2520
2521
buf(pos) ='-'
2521
2522
pos +=1
2522
2523
}
@@ -2526,7 +2527,6 @@ final class JsonWriter private[jsoniter_scala](
2526
2527
buf(pos +2) ='0'
2527
2528
pos +=3
2528
2529
} else {
2529
-
valbits= java.lang.Float.floatToIntBits(x)
2530
2530
vare2= (bits >>23&0xFF) -150
2531
2531
varm2= bits &0x7FFFFF|0x800000
2532
2532
varm10, e10=0
@@ -2635,9 +2635,10 @@ final class JsonWriter private[jsoniter_scala](
2635
2635
// "The Schubfach way to render doubles": https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view
2636
2636
// Sources with the license are here: https://github.com/c4f7fcce9cb06515/Schubfach/blob/3c92d3c9b1fead540616c918cdfef432bca53dfa/todec/src/math/DoubleToDecimal.java
2637
2637
private[this] defwriteDouble(x: Double):Unit= {
2638
+
valbits= java.lang.Double.doubleToLongBits(x)
2638
2639
varpos= ensureBufCapacity(24)
2639
2640
valbuf=this.buf
2640
-
if (x<0.0) {
2641
+
if (bits<0L) {
2641
2642
buf(pos) ='-'
2642
2643
pos +=1
2643
2644
}
@@ -2647,7 +2648,6 @@ final class JsonWriter private[jsoniter_scala](
Copy file name to clipboardExpand all lines: jsoniter-scala-core/jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonWriter.scala
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2250,17 +2250,17 @@ final class JsonWriter private[jsoniter_scala](
2250
2250
// "The Schubfach way to render doubles": https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view
2251
2251
// Sources with the license are here: https://github.com/c4f7fcce9cb06515/Schubfach/blob/3c92d3c9b1fead540616c918cdfef432bca53dfa/todec/src/math/FloatToDecimal.java
2252
2252
private[this] defwriteFloat(x: Float):Unit= {
2253
+
valbits= java.lang.Float.floatToRawIntBits(x)
2253
2254
varpos= ensureBufCapacity(15)
2254
2255
valbuf=this.buf
2255
-
if (x<0.0f) {
2256
+
if (bits<0) {
2256
2257
buf(pos) ='-'
2257
2258
pos +=1
2258
2259
}
2259
-
if (x ==0.0f) {
2260
+
if (bits <<1==0) {
2260
2261
ByteArrayAccess.setInt(buf, pos, 0x302E30)
2261
2262
pos +=3
2262
2263
} else {
2263
-
valbits= java.lang.Float.floatToRawIntBits(x)
2264
2264
vare2= (bits >>23&0xFF) -150
2265
2265
varm2= bits &0x7FFFFF|0x800000
2266
2266
varm10, e10=0
@@ -2362,17 +2362,17 @@ final class JsonWriter private[jsoniter_scala](
2362
2362
// "The Schubfach way to render doubles": https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view
2363
2363
// Sources with the license are here: https://github.com/c4f7fcce9cb06515/Schubfach/blob/3c92d3c9b1fead540616c918cdfef432bca53dfa/todec/src/math/DoubleToDecimal.java
Copy file name to clipboardExpand all lines: jsoniter-scala-core/native/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonWriter.scala
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2250,17 +2250,17 @@ final class JsonWriter private[jsoniter_scala](
2250
2250
// "The Schubfach way to render doubles": https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view
2251
2251
// Sources with the license are here: https://github.com/c4f7fcce9cb06515/Schubfach/blob/3c92d3c9b1fead540616c918cdfef432bca53dfa/todec/src/math/FloatToDecimal.java
2252
2252
private[this] defwriteFloat(x: Float):Unit= {
2253
+
valbits= java.lang.Float.floatToRawIntBits(x)
2253
2254
varpos= ensureBufCapacity(15)
2254
2255
valbuf=this.buf
2255
-
if (x<0.0f) {
2256
+
if (bits<0) {
2256
2257
buf(pos) ='-'
2257
2258
pos +=1
2258
2259
}
2259
-
if (x ==0.0f) {
2260
+
if (bits <<1==0) {
2260
2261
ByteArrayAccess.setInt(buf, pos, 0x302E30)
2261
2262
pos +=3
2262
2263
} else {
2263
-
valbits= java.lang.Float.floatToRawIntBits(x)
2264
2264
vare2= (bits >>23&0xFF) -150
2265
2265
varm2= bits &0x7FFFFF|0x800000
2266
2266
varm10, e10=0
@@ -2362,17 +2362,17 @@ final class JsonWriter private[jsoniter_scala](
2362
2362
// "The Schubfach way to render doubles": https://drive.google.com/file/d/1luHhyQF9zKlM8yJ1nebU0OgVYhfC6CBN/view
2363
2363
// Sources with the license are here: https://github.com/c4f7fcce9cb06515/Schubfach/blob/3c92d3c9b1fead540616c918cdfef432bca53dfa/todec/src/math/DoubleToDecimal.java
0 commit comments