Git Product home page Git Product logo

Comments (5)

KrisXV avatar KrisXV commented on August 10, 2024 1

That's not correct, this isn't a bug, this is 100% intentional.

from damage-calc.

AnnikaCodes avatar AnnikaCodes commented on August 10, 2024

Why is this impossible? A level 1 Ralts has very low HP, so for a powerful attack to do between 2,600 and 5,600 times its HP is not that unreasonable?

from damage-calc.

InvalidOS avatar InvalidOS commented on August 10, 2024

The impossible part is the extremely low damage rolls. Stuff like the 5500 BP Last Respects doing 64 damage, or even the 5050 BP one doing 3876. Those numbers are absurdly low for the moves being used.

from damage-calc.

KrisXV avatar KrisXV commented on August 10, 2024

That’s because of damage overflow.

from damage-calc.

mmorrisonlk avatar mmorrisonlk commented on August 10, 2024

Expanding on what KrisXV said about damage overflow. The calculator has several references to OF32 which is defined in the util file as export function OF32(n: number) { return n > 4294967295 ? n % 4294967296 : n; } This function takes a number n and checks if it's over the unsigned 32 bit integer limit. If it is more than the limit it divides that by the integer limit and returns the remainder as the new value of n. So if we were counting at the top end it would go 4294967295, 4294967296, 1, 2, 3..

The surprisingly low values you noticed are one of the areas where the remainder of the division ends up on the smaller end. Though I'm sure that means that several values are over the integer limit even if it isn't as obvious as the 64 result. This limitation is not so much a limitation of the damage calculator but a limitation of how numbers are handled by TypeScript. There is likely a solution to this problem but it would involve a far more extensive rewrite of the overall calculator only to accommodate amusing theory crafting of absurd conditions.

In short, your number got too big. The calculator lied to you to save your computer getting upset with you. Unless this applies in a scenario remotely achievable in game then it isn't likely to be worth the time it would take to fix. Maybe they could consider adding an error message to let you know that you have caused an integer overflow and it had to round the number down? If people are really bothered by it.

from damage-calc.

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.