Code Monkey home page Code Monkey logo

Comments (6)

theburningmonk avatar theburningmonk commented on June 16, 2024

I suspect in this case it might be that you're running into a case where you start to lose precisions with floating point. e.g.

I get these in LinqPad:

    double a = 10205471065416239;
    double b = 10205471065416240;
    double c = 10205471065416241;
    double d = 10205471065416242;

    double e = 10205471065416056;
    double f  = 10205471065416057;

    a.ToString("r").Dump(); // 10205471065416240
    b.ToString("r").Dump(); // 10205471065416240
    c.ToString("r").Dump(); // 10205471065416240
    d.ToString("r").Dump(); // 10205471065416242
    e.ToString("r").Dump(); // 10205471065416056
    f.ToString("r").Dump();  // 10205471065416056

So looks like we may not have solved the problem the last time around.

In .Net we're somewhat limited with what we can do with a 64-bit double, but in cases where there is no decimals we can get away with using a BigInteger.

How is the key represented in your code? Are they stored as a int64?

from dynamodb.sql.

zairnamlas avatar zairnamlas commented on June 16, 2024

Yeah, they are "long". I've discovered that precesion go out when the long is even.

from dynamodb.sql.

theburningmonk avatar theburningmonk commented on June 16, 2024

ok, thanks, I think I know what to do here - use BigInteger when there's no decimal - to solve this

from dynamodb.sql.

zairnamlas avatar zairnamlas commented on June 16, 2024

Sounds good.

from dynamodb.sql.

theburningmonk avatar theburningmonk commented on June 16, 2024

@zairnamlas - did the fix work for you guys? If so, I'll close the issue

from dynamodb.sql.

zairnamlas avatar zairnamlas commented on June 16, 2024

Yeah, it looks like ok. It is fetching results now. Thanks Yan.

from dynamodb.sql.

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.