Coder Social home page Coder Social logo

Comments (3)

caseman avatar caseman commented on June 24, 2024

Interesting. This doesn't crash on macos, but does on Linux. I'll take a look

from noise.

caseman avatar caseman commented on June 24, 2024

It looks like the (my) code naively presumes that the base is in the range of 0..255, although other values can accidentally work they may read from outside the lookup table. Actually it's worse than that and even values in that range can result in reading garbage. Reading garbage will result in seemingly ok results on some platforms (it is a pseudo-random function after all), but on others with stricter memory access it crashes as you noted.

Anyway it's fixable but the internal api will need an adjustment. For some reason base is currently an integer, which only makes sense if you subscribe to the rather insane presumptions of the present code. It would be better for it to be a float and have it interact with the coordinates before they are mapped to the lookup table.

I'll work on a fix, but for now you can workaround by adding the base value to the input coordinates yourself, and leaving base at zero, which should not crash. The base value concept is a bit dubious anyway, and the implementation doubly so. Some self flagellation is possibly in order as well.

from noise.

Shtong avatar Shtong commented on June 24, 2024

Yeah, actually I started working assuming the base was a float, which is actually what the method signature in the help pages hints at: "base=0.0". Thankfully the error message was relatively explicit :)

I'll manually add the base as you suggest.

from noise.

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.