Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

[External] Mono gives an incorrect result for BigInteger --> int64 conversion in an obscure case #190

Closed
ghost opened this issue Nov 29, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 29, 2013

This is very corner case!!

Mono should raise a System.OverflowException for this obscure case when converting a large negative biginteger to an int64. Instead it returns a positive int64.

open System.Numerics

let x = -1I * BigInteger.Pow(2I,63)
int64 (x - 1I)

// The value is -9223372036854775809
// Mono gives: val it : int64 = 9223372036854775807L
// .NET gives: System.OverflowException

@ghost ghost closed this as completed Nov 30, 2013
@migueldeicaza
Copy link
Member

hello Don,

Why was this issue closed?

@ghost
Copy link
Author

ghost commented Dec 2, 2013

Recorded as mono bug https://bugzilla.xamarin.com/show_bug.cgi?id=16526

RAOF added a commit to RAOF/fsharp that referenced this issue Jul 8, 2014
The Mono bug this is working around was fixed in late 2013, and is in the Mono 3.2 series
that F# already strongly recommends.
fsgit added a commit that referenced this issue Jul 8, 2014
directhex pushed a commit to mono/linux-packaging-fsharp that referenced this issue Sep 17, 2014
The Mono bug this is working around was fixed in late 2013, and is in the Mono 3.2 series
that F# already strongly recommends.

(cherry picked from commit 28db078)
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant