Giter Site home page Giter Site logo

Numeric Comparisons about qtspecs HOT 5 OPEN

michaelhkay avatar michaelhkay commented on July 18, 2024
Numeric Comparisons

from qtspecs.

Comments (5)

ChristianGruen avatar ChristianGruen commented on July 18, 2024

A good summary.

Would being bold mean that <x>3.1</x>[. = 3.1] would return no more result in the future? If the answer is yes, could we be even bolder and convert untyped atomics to decimals (instead of doubles)?

from qtspecs.

michaelhkay avatar michaelhkay commented on July 18, 2024

(a) Yes, and (b) yes, that would be even bolder - and would no doubt lead to a further batch of compatibility problems.

I have started thinking about whether it might be possible to have an "arithmetic mode" in the dynamic context, set to either "double" or "decimal", used to control all of these things. But it's a big sledgehammer: would people have fewer problems than they had before, or would we just introduce new problems?

from qtspecs.

ChristianGruen avatar ChristianGruen commented on July 18, 2024

(a) Yes, and (b) yes, that would be even bolder - and would no doubt lead to a further batch of compatibility problems.

In that case, I’d tend to be timid (to be very bold, I know too less about the further batch), and I’d tend to avoid new (explicit) options. As we talk about fairly fundamental features, I assume it would make everyone’s life more difficult.

would people have fewer problems than they had before,

Aside from the (now ancient) confusion over implicit double conversions, I was not aware of the problems myself. Do you think they could be summarized to assess their seriousness?

Looking forward to other opinions as well.

from qtspecs.

michaelhkay avatar michaelhkay commented on July 18, 2024

Well, apart from the usability problems caused by the fact that people don't understand floating-point arithmetic, I think the number one issue we are trying to solve is the transitivity problem. That primarily affects grouping and sorting, and we could try to limit the compatibility hit by only making changes to the places that are most directly affected: distinct-values(), group by, order by etc. Alternatively, we could restrict these so that mixed numeric types aren't allowed (or are treated as always distinct).

Looking at the list, I think it's probably deep-equal that has opened the can of worms, because we use it both in places where strict transitivity is needed, and in places where a "more forgiving" equality test is desirable. Perhaps if deep-equal() had an option to control numeric comparison, life would be a bit easier?

from qtspecs.

ChristianGruen avatar ChristianGruen commented on July 18, 2024

Perhaps if deep-equal() had an option to control numeric comparison, life would be a bit easier?

That could be an “option” indeed (given that we already have so many other options now… And I assume that most people won’t care anyway).

from qtspecs.

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.