Description

In C++, arithmetic operators * and / have the same priority and therefore should be resolved left to right. In this case, * is being resolved first and / second.

1/128*128 and (1/128)*128 should produce the same answer, but when applied to a number box in the editor they behave differently. See attached image

This does occur in //UE4/Release-4.24 cl 11590231 so I am not marking this as a regression.

Steps to Reproduce
  1. Open a project
  2. Select something in the viewport
  3. Select a number box in the details panel
  4. Enter the equation: 1/128*128

Result
The editor will parse the equation as 0.000067

Expected
The editor will parse the equation as 1.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-96162 in the post.

2
Login to Vote

Duplicate
ComponentTools
Affects Versions4.25
CreatedJul 30, 2020
ResolvedAug 26, 2020
UpdatedSep 2, 2020
View Jira Issue