mojira.dev
MC-212345

Scaling during execute store command causes loss of precision when given precision number

When using the "scale" parameter in the "execute store" command, the final output is equivalent to if the input was treated as an integer, even when the attached command returns a single- or double-precision number. Why should this be the case?

 

How to recreate:

Store a dummy NBT value in storage as a double.

data merge storage dummy {test:4.2d}

Grab the NBT value in storage and store it after scaling the value using the execute store command

execute store result storage dummy test2 double 2.5 run data get storage dummy test

Grab this new test2 value from storage

data get storage dummy test2

In my example, instead of the game returning "10.5d", it returns "10.0d" which is accomplished if you take the product of 4.0 and 2.5. The game treated test1 as an int even though the value returned from the "data get" command is a double. If the "data" command returns a double and the scaling factor is a double, why should the nbt value be changed to an int? It seems like an unnecessary way to lose precision in your calculations.

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MC-121824, so this ticket is being resolved and linked as a duplicate.

That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit

NoRamen

(Unassigned)

Unconfirmed

(Unassigned)

21w03a, 1.16.5

Retrieved