Bug 22957 - NMath.Min incorrect implementation
Summary: NMath.Min incorrect implementation
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 8.0.0 (iOS 8)
Assignee: Bugzilla
Depends on:
Reported: 2014-09-12 16:20 UTC by Rustam Zaitov
Modified: 2014-09-17 11:04 UTC (History)
3 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rustam Zaitov 2014-09-12 16:20:14 UTC
Xamarin.iOS: Version:

Looks like we have a bug for NMath.Min:

public static nint Min (nint val1, nint val2)
	return (!(val1 > val2)) ? val2 : val1;

Looks like copy-paste from Max method. The same for overloads.
I took this from assembly browser
Comment 1 Sebastien Pouliot 2014-09-12 16:34:50 UTC
Fixed in master 831efd139477d858da49e743a1c15e646eb13ce0

Also backported to 8.2 and might backport to 8.0
Comment 2 Sebastien Pouliot 2014-09-12 16:44:12 UTC
Backported in monotouch-8.0.0-branch in 3b8e1625003ed2745985b6c3b6a2dd8f4932e941
Comment 3 Ram Chandra 2014-09-17 11:04:15 UTC
I have checked this issue with following builds:

Mac OS X 10.9.3
Xamarin Studio: 5.4 (build 239)
Mono 3.8.0 ((no/45d0ba1)
Xcode 6.0 (6194.24)
Build 6A216f
Xamarin.iOS : (Business Edition)
=== Build Information ===

Release ID: 504000239
Git revision: 338110385bb89c5774e89ffcb15d8f2039e7fbcd
Build date: 2014-09-16 12:25:53-04
Xamarin addins: 05241f5ab70cf79388a0f113bc6877780ed1024a

I have checked the definition of Min method in NMath class in assembly browser and observed that now the condition is updated for the Min(nint, nint) method.

	public static nint Min(nint val1, nint val2)
		return (!(val1 < val2)) ? val2 : val1;

This issue has been fixed. Hence, I am closing this issue.