Reporter | porges (porges) |
---|---|
Created | Mar 15, 2012 3:25:59 AM |
Updated | Mar 15, 2012 3:25:59 AM |
Priority | Normal |
Type | Unspecified |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Unassigned |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
In the following code:
R# marks the "float" cast as redundant. It is not. Removing it changes the result, as the intermediate value is no longer converted to float32 before conversion to int.
string value = "0.01"; float convertedValue = float.Parse(value); Console.WriteLine((int)((float)(convertedValue * 100.0f)));
R# marks the "float" cast as redundant. It is not. Removing it changes the result, as the intermediate value is no longer converted to float32 before conversion to int.