Giter Site home page Giter Site logo

Zeros store negative about fraction HOT 4 CLOSED

dnsl48 avatar dnsl48 commented on September 4, 2024
Zeros store negative

from fraction.

Comments (4)

karasjoh000 avatar karasjoh000 commented on September 4, 2024

not all zeros but I think after a number turns into a 0 from a negative on the Ops.

from fraction.

karasjoh000 avatar karasjoh000 commented on September 4, 2024

Although if it returns equals on -0 and 0 it should be fine. Did not have time to check yet.

from fraction.

dnsl48 avatar dnsl48 commented on September 4, 2024

yes, that's been intentional so far. We even have a separate method Fraction::neg_zero().

However, now I'm contemplating the actual benefits of having negative zeroes. Rust core float implementation does handle negative zeroes and zeroes as the same thing, so do we to be compatible. I'm not sure we need this any more. Perhaps worth deprecating and removing them.

from fraction.

dnsl48 avatar dnsl48 commented on September 4, 2024

Although if it returns equals on -0 and 0 it should be fine. Did not have time to check yet.

Yes, they are equals. We have it covered with tests
https://github.com/dnsl48/fraction/blob/master/src/fraction/mod.rs#L2746

If you have any other questions or recommendations that we can consider when deciding on if it's worth deprecating negative zeroes and removing those, please feel free to leave them here and reopen or make a new issue.

Cheers

from fraction.

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.