-3

I'm currently making a new project on c# and i have a problem - calculations are wrong. My calculation is 1 * (1 + (1 - 160 / 180)) but it returns 2. I checked this in my calculator and the right answer is 1.11111... Please help! P. S. sorry for my bad english

1 Answers1

2

160 / 180 is integer division and will result in 0.

Try using 160.0/180 in order to promote the result a double.

JCWasmx86
  • 3,473
  • 2
  • 11
  • 29