Giter Club home page Giter Club logo

Comments (5)

zookozcash avatar zookozcash commented on July 19, 2024 1

Re "floatish", the problem is that if we send or accept decimals in the
API, then a lot of programmers will use floats/doubles to produce or
consume those numbers, which will lead to bugs.

It's entirely possible to use a proper decimal datatype instead of
floats/doubles in all modern languages, so a potential mitigation is just
to add documentation saying "do NOT ever use floats/doubles to store or
process this. There is a library in your language that handles decimals. Go
find out and use it and nothing but it to handle these numbers."

Here's a simple example of the problems with using floats for decimals: 0.1

  • 0.1 != 0.01

Not only is 0.1 times 0.1 not exactly 0.01, it isn't even the closest
possible
number to 0.01.

https://web.archive.org/web/20140723054136/https://zooko.com/uri/URI:DIR2-MDMF-RO:dwvqalbdt4ax4vgupcewxljg3u:bej7hhojmpuugy77oyydmazf6uu7huiipkctih7adky7e6txavnq/klog.html#pyutil.jsonutil

On Jul 20, 2016 10:52 AM, "Nathan Wilcox" [email protected] wrote:

Unresolved issue: How do we represent values in the API? We want lossless
representation, but we also are dealing with Bitcoin's API which may use
"float-ish" numbers. Something to review and make an explicit decision on.

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#56 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/APp9QFNXyBUCPrv5CeOBs5zjQsm7WECIks5qXlIxgaJpZM4JQ52P
.

from zips.

nathan-at-least avatar nathan-at-least commented on July 19, 2024

Related is how to manage proving parameters: zcash/zcash#432 (comment)

Tangential topics for SPV clients: #288 delegated JoinSplit detection and #1113 delegated proving.

from zips.

nathan-at-least avatar nathan-at-least commented on July 19, 2024

Unresolved issue: How do we represent values in the API? We want lossless representation, but we also are dealing with Bitcoin's API which may use "float-ish" numbers. Something to review and make an explicit decision on.

from zips.

ebfull avatar ebfull commented on July 19, 2024

Hm, is the payment API in scope for the specification?

from zips.

daira avatar daira commented on July 19, 2024

I'm deciding that it is not in scope for the specification, but should be maintained as a ZIP. Can someone convert https://github.com/zcash/zcash/blob/master/doc/payment-api.md to rST and submit it please?

from zips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.