- Home /
Periodic fraction gets converted to int
Hello, What I want to do is to devide 27 by ⁴/₃. Unity turns ⁴/₃ to 1 and I don't want it to be this way. I want Unity to do the math without converting ⁴/₃ to an int. How to do that?
Comment
Best Answer
Answer by Tsaras · Mar 07, 2019 at 07:01 PM
Type float division = 27/(4/3f);
. The f forces the evaluation to be on floating point numbers.
Your answer
Follow this Question
Related Questions
Is it possible to round down 0.99 to 0? 2 Answers
How to round or convert doubles? 2 Answers
Float to Int 4 Answers
Rounding to the nearest int as a Result of a Function? 1 Answer
[RESOLVED] Raycast - Calculate Angular Difference from Object 3 Answers