Giter VIP home page Giter VIP logo

Comments (5)

giacomocavalieri avatar giacomocavalieri commented on August 11, 2024

What version of otp are you using? I noticed this happens for the latest release 27.0, it is a known breaking change, we'll have to decide how to handle it

from stdlib.

thorhj avatar thorhj commented on August 11, 2024
› erl --version
Erlang/OTP 27 [erts-15.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]

from stdlib.

giacomocavalieri avatar giacomocavalieri commented on August 11, 2024

Oh yeah that's a breaking change introduced by OTP 27.0: https://erlang.org/documentation/doc-15.0-rc1/doc/upcoming_incompatibilities.html#0-0-and-0-0-will-no-longer-be-exactly-equal

@lpil what do you think we should do here?

from stdlib.

lpil avatar lpil commented on August 11, 2024

Let's change it to this:

  float.negate(0.0)
  |> float.negate
  |> should.equal(0.0)

from stdlib.

inoas-nbw avatar inoas-nbw commented on August 11, 2024

Would it be useful to keep consistency and both return -0.0 / -0 on erlang/js by checking if it is 0 and in that case switching the sign in the js impl ) inside a do_negate for this?

import gleam/float
import gleam/io

pub fn main() {
  0.0 |> float.negate |> io.debug
}

... and if not, would it not be useful to make it obvious from otp27 onward in the stlib test suite that the expected value differs between targets?

from stdlib.

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.