Bug 20721 - A cast of double to int can possibly result in int.MinValue
Summary: A cast of double to int can possibly result in int.MinValue
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-06-19 13:21 UTC by John Miller [MSFT]
Modified: 2018-03-02 19:45 UTC (History)
5 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description John Miller [MSFT] 2014-06-19 13:21:12 UTC
## Overview: 

    Sometimes truncating a perfectly normal positive double value (for example 18.1000359277301) with (int) results in int.MinValue (-2147483648).

## Additional Information: 

    No test case available.
Comment 3 John Miller [MSFT] 2014-06-19 16:03:36 UTC
## Additional Note

    Only reports from Xamarin.Android. No reports of this happening on iOS or on Mono desktop.
Comment 4 Ludovic Henry 2018-02-28 21:33:51 UTC
If we still have a contact with the customer, we should ask him to enable/disable `float32` and check with that, and also to reproduce with latest version of XA. Otherwise we would need an app that repro it, even just binaries. Is that something you think could be done?
Comment 5 Jonathan Pryor 2018-03-02 19:45:36 UTC
> we should ask him to enable/disable `float32`

We'd need to know *how* to do that.

I *think* that could be done with:

> adb shell setprop debug.mono.runtime_args '"-O=float32"'

Note You need to log in before you can comment on or make changes to this bug.