Skip to content

Instantly share code, notes, and snippets.

@sssbohdan
Last active April 22, 2023 19:53
Show Gist options
  • Save sssbohdan/0a230974ccaec3e15064404e5a022e85 to your computer and use it in GitHub Desktop.
Save sssbohdan/0a230974ccaec3e15064404e5a022e85 to your computer and use it in GitHub Desktop.
Decimal
let res = Decimal(string: "9999999999999999999999999999999999999999999")!
* Decimal(string: "99999999999998999999999999999999999")!
print(res) // 999999999999989999999999999999999989990000000000000000000000000000000000000000 - wrong
// correct result – 999999999999989999999999999999999989999999900000000000001000000000000000000001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment