Open Kekht opened 1 month ago
It seems that solution is to use .0 for such cases in any operand, e.g.:
{local test = 5/10.0}
; 5/10 = {test}
Now gives:
; 5/10 = 0.5
That is still obvious and should be updated at Knowledge Base.
For example there are arithmetic operations exaple shows:
M104 S{first_layer_temperature[0] * 2/3}
if that 2/3 operand somehow pre-calculated, and expressed as (2/3):
{local tempPart = 2/3}
...
M104 S{first_layer_temperature[0] * 2/3}
then we will get M104 S0
Description of the bug
Somehow weirdly PrusaSlicer does not do floating point arithmetic division, casting every part of any expression to lesser integer. This is weird behaviour, because Prusa Knowledge Base mentions such functions as int(), round() and digits(), wich supposed to work with floating point. Also current behaviour makes meaningless mentioning of those functions at Prusa Knowledge Base and forces to use some crutches to get proper value.
Project file & How to reproduce
In any g-code macro field:
will produce
; 5/10 = 0
Checklist of files included above
Version of PrusaSlicer
2.8.1-win64
Operating system
Windows 10
Printer model
any