Bug 22591 - Default BigInteger() causes exceptions and incorrect answers
Summary: Default BigInteger() causes exceptions and incorrect answers
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: General ()
Version: 3.6.0
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-09-03 05:30 UTC by F# Software Foundation
Modified: 2014-12-01 09:55 UTC (History)
3 users (show)

Tags:
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 GitHub or Developer Community 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:
Status:
RESOLVED FIXED

Description F# Software Foundation 2014-09-03 05:30:29 UTC
This looks related to https://bugzilla.xamarin.com/show_bug.cgi?id=11945

The default value for BigInteger gives incorrect values in many cases, for example

        Assert.AreEqual(BigInteger.Abs(BigInteger()), 0I)
        Assert.AreEqual((BigInteger() / 123I),0I)

        qr <- BigInteger.DivRem(BigInteger(), 1I)
        Assert.AreEqual(qr, (0I, 0I))


        CheckThrowsDivideByZeroException(fun () -> BigInteger.DivRem(BigInteger(), BigInteger()) |> ignore)

all fail (this is F# syntax - 0I is the zero value for BigInteger, i.e. BigInteger.Zero).
Comment 1 Marek Safar 2014-09-08 08:51:46 UTC
Fixed in master
Comment 2 Parmendra Kumar 2014-12-01 09:55:05 UTC
I have checked this issue and observed that BigInteger() does not throw any exception.

Please refer the Screencast:http://www.screencast.com/t/jx0Lumuo

Environment info:
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Xamarin   3.9.28.0
Xamarin.Android   5.0.0.0 
Xamarin.iOS   8.6.0.0 


As of now I am closing this issue, please let me know if I need to verify anything else?

Thanks