Bug 46970 - Divide by zero bug, or possible (double) bug
Summary: Divide by zero bug, or possible (double) bug
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-15 03:06 UTC by civilwarrock
Modified: 2017-10-06 23:43 UTC (History)
3 users (show)

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


Attachments

Description civilwarrock 2016-11-15 03:06:04 UTC
If you run the following code on Windows i will be: -2147483648, and that is using .Net Framework 4.0
However if you run the following code on Mono using version 4.6.1 JIT, i will be: 2147483647.

int a = 0;
int b = 20;
int i = (int)(((double)System.Math.Abs(a - b) / (double)a) * 100);
Console.WriteLine(i.ToString());
Console.ReadLine();


I thought you guys would like to know this problem exists.
Comment 1 Ludovic Henry 2017-10-06 23:43:00 UTC
I cannot repro with Mono 5.8.0.2 (2017-10/a3943e28cf8) on macOS and Mono 5.2.0.215 on Ubuntu 16.04 64bits

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