float*int = int ?

I have this code: (model.VolumeLevel/100f) * maxVolume
VolumeLevel is an int, maxVolume is an int.
As there is a float, the result should be a float.

But in Mono/Xamarin , while debugging this code, if i enter this expression in the Watch window, the returned result is an INT !!!! And the value is rounded to the nearest integer ... This is not the fault of the watch window in fact. The result in the code is also incorrect.

Xamarin.Android Version: 4.8.2
Tested on device: Nexus 7 / Android 4.2.

Build Information
Release ID: 401100014
e88e6ef4416e4f8ca405a372df4f26cd67a2e8f6
Build date: 2013-09-05 16:32:19Z
Xamarin addins: 0a3cbd89efe969c522b81dc7c24d7da1564df585

Operating System
Windows 6.1.7601.65536 (64-bit)

Answers

  • CheesebaronCheesebaron DKInsider, University mod

    I can't reproduce your problem.

    Tried this in LinqPad:

    LinqPad

    and the same in an Android app:

    Android App

    Both are of type Single. Sure the first one does not have any decimals, but it does not make it less floaty.

  • softlionsoftlion FRBeta ✭✭✭

    Look at this screen capture ...
    It is ugly !!!!
    This is a very big bug, or i'm missing something !

  • CheesebaronCheesebaron DKInsider, University mod

    It might be a bug in the debug Watch window. Not sure :-/

  • DWestyDWesty USMember ✭✭

    I think @Cheesebaron is correct. I get the correct result from the operation but the debug window shows it as an int... Weird bug.

Sign In or Register to comment.