Number literal exceeded available precision warning isn't insightful

As a Roblox developer, it is currently too hard to look through Script Analysis and scripts with this warning clogging my scripts without feeling like there’s something wrong with my code.

image

If Roblox is able to address this issue, it would improve my development experience because it feels there’s no action I can take from this warning, and the only way I can stop it from appearing is by formatting it with scientific notation which feels really limiting for trivial numbers (for example - this happens with 6Qn in a script). It’s the same number in the end, it’s just easier for me to process numbers around here as whole digits.

I understand that large numbers will lose precision, just like other developers do who create number simulators and alike, and that’s okay, but for my game that works with large numbers and has many weapons which deal high amounts of damage, this warning does not help me improve my code and only makes it tedious having to work around it.

I would appreciate it if either this warning didn’t appear for regular numbers, or if there was a way to turn it off. That’s all, thank you!

You should absolutely not be working with damage values so large, you are programming in bugs by nature; these values will never be processed by your code correctly, any math you do is inherently broken. You can have these numbers within representable bounds and display them in UI larger if that’s really what you want, but the fact of the matter is that this being an issue for you is simply a case of “doing it wrong”.

1 Like

A) --!nolint
b) 6_666_666_666_666_666_666_666.0

4 Likes

One example is I give a player a rank at level 1 decillion - by default this number is inside of a table without notation, so this warning would pop up in Script Analysis even though it would still give the player the rank at level 1 decillion properly - levels are given at rates of nonillions at this point, so the loss of accuracy is hard to tell, as I adjust my number formatting modules to format it nicely regardless so it’s more digestible.

You can also use --!nolint IntegerParsing to not lose other linting features

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.