Suggestion Closed · Implemented

Add BigDouble Variable Type for Precision Math

#2214 opened by Unknown 5 years ago

Unknownreported this suggestion

Summary

I am asking Mythicmobs to count by 0.05 every second, and it is adding very tiny extra numbers onto 0.05.

Steps to reproduce

In mobs folder

  • skill{s=AddExtinguish;sync=true} @self ~onTimer:20

In skills folder

AddExtinguish:

Conditions:

  • variableInRange{var=Global.StartUp;value=>0}

Skills:

  • variableadd{var=global.extinguish;a=0.05}

Current behavior By using - message{m="<global.var.extinguish>"} @PIR{r=30} We can see the value of the variable. The count in chat goes like this: 0.05 0.1 0.15 0.2 0.25 0.3 0.35000002 0.40000004 0.45000005 0.50000006 0.5500001 0.6000001 0.6500001 0.7000001 etc. Picture: [Legacy attachment omitted] Intended correct behavior

Should count without the strange extra numbers at the end

Server log file

https://mclo.gs/VLk8n6T

Unknowncommented

This is a problem with the double datatype in general and isn't something we can fix. I will look into adding another variable type for when more precision is needed, though.

Sign in to join the discussion.