MerlinVR / UdonSharp

An experimental compiler for compiling C# to Udon assembly
MIT License
678 stars 89 forks source link

Simple Division Error #54

Closed RyanKruse closed 4 years ago

RyanKruse commented 4 years ago

Describe the bug in detail: An arithmetic error occurs when doing a math equation.

Provide steps/code to reproduce the bug: int a = 5 int b = 11

debugText.text = "Math Equation: " + (a / (b - 1));

Expected behavior: Expected result should equal 0.5.

Additional Information: Instead the result shows to be 0.

ScruffyRules commented 4 years ago

You're doing Integer math so the actual results are correct, see Integer division for more info.

RyanKruse commented 4 years ago

Oops, yeah that'll do it. Thanks.