8000 Numbers bigger than `1L << 53` loose lower bits when parsing by default parser using Scala.js · Issue #2311 · circe/circe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Numbers bigger than 1L << 53 loose lower bits when parsing by default parser using Scala.js #2311
Open
@plokhotnyuk

Description

@plokhotnyuk

Script to reproduce:

//> using dep "io.circe::circe-core::0.14.10"
//> using dep "io.circe::circe-parser::0.14.10"
////> using dep "io.circe::circe-jawn::0.14.10"

import io.circe.Json
import io.circe.parser._
//import io.circe.jawn._

println(parse("[9007199254740993,9999999999999999999]").getOrElse(null))

Store it to script.js and use the following command to build with latest scala-cli:

scala-cli --power package --js --js-mode release script.sc --force -o script.js

Result of running with node:

[
  9007199254740992,
  10000000000000000000
]

Expected output:

[
  9007199254740993,
  9999999999999999999
]

Works fine with circe-jawn instead of circe-parser, or using JVMs or Scala Native.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0