Giter VIP home page Giter VIP logo

Comments (3)

bob-carpenter avatar bob-carpenter commented on August 24, 2024

It was a rookie mistake on my part just using int in the beginning.

Rather than (1) or (2), how about:

  1. Replace all of the int types with the size-specific C++11 int64_t type.

I'd also be OK with a typedef set to that value if you think it may change again in the future. I'm not worried about mildly breaking backward compatibility in the case of a Stan program that relies on integer overflow behavior.

from stan.

WardBrian avatar WardBrian commented on August 24, 2024

This is blocked partially by our current IO mechanisms, since the model classes' write_array serializes everything as a double.

Every int32 is representable in a double more-or-less exactly, but not every int64 is. For a classic example, 2^53 +1 is a totally valid integer, but it's nearest double representation is indistinguishable from 2^53

Now, @mitzimorris's ongoing look at re-thinking the IO has essentially already determined that this current way of doing things in write_array needs to go if we want other nice features, so hopefully we won't need to worry about this when the time comes.

from stan.

SteveBronder avatar SteveBronder commented on August 24, 2024

Replace all of the int types with the size-specific C++11 int64_t type.

Yes I like that

This is blocked partially by our current IO mechanisms, since the model classes' write_array serializes everything as a double.

Ooof, did not know that.

Yeah this is not a huge rush thing and idt it will be a problem for the foreseeable future. We can certainly handle the problems around this until we are ready for this

from stan.

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.