i = 200 / 3
is performing integer division.
Try either:
i = (double)200 / 3
or
i = 200.0 / 3
or
i = 200d / 3
Declaring one of the constants as a double will cause the double division operator to be used.
More Related Contents:
- Why does integer division in C# return an integer and not a float?
- What’s wrong with this division? [closed]
- How can I calculate divide and modulo for integers in C#?
- Check if the two Files exist in the folder
- Getting ServiceStack to retain type information
- Passing properties by reference in C#
- Workaround for lack of ‘nameof’ operator in C# for type-safe databinding?
- How to call base.base.method()?
- SQL injection on INSERT
- Regarding local variable passing in Thread
- Globally convert UTC DateTimes to user specified local DateTimes
- Multi-Tenant With Code First EF6
- How can I read/stream a file without loading the entire file into memory?
- Unable to create migrations after upgrading to ASP.NET Core 2.0
- How to ensure a timestamp is always unique?
- How to remove numbers from string using Regex.Replace?
- Is it possible to create a new operator in c#?
- How do I include subclasses in Swagger API documentation/ OpenAPI specification using Swashbuckle?
- Capturing mouse events from every component
- How to Change Pixel Color of an Image in C#.NET
- ForEachAsync with Result
- Nullable types: better way to check for null or zero in c#
- How to unit test if my object is really serializable?
- Are there any benefits to using a C# method group if available?
- Detect BitLocker programmatically from c# without admin
- String.Empty versus “” [duplicate]
- NHibernate.MappingException: No persister for: XYZ
- How to bind Dataset to DataGridView in windows application
- Hide a C# program from the task manager?
- Display string as html in asp.net mvc view