corrected range chec
authorhaftmann
Fri, 16 Jul 2010 15:28:23 +0200
changeset 37846 6f8b1bb4d248
parent 37845 b70d7a347964
child 37847 425dd7d97e41
child 37876 48116a1764c5
corrected range chec
src/HOL/Library/Efficient_Nat.thy
--- a/src/HOL/Library/Efficient_Nat.thy	Fri Jul 16 15:28:22 2010 +0200
+++ b/src/HOL/Library/Efficient_Nat.thy	Fri Jul 16 15:28:23 2010 +0200
@@ -312,9 +312,9 @@
   def equals(that: Nat): Boolean = this.value == that.value
 
   def as_BigInt: BigInt = this.value
-  def as_Int: Int = if (this.value >= Math.MAX_INT && this.value <= Math.MAX_INT)
+  def as_Int: Int = if (this.value >= Math.MIN_INT && this.value <= Math.MAX_INT)
       this.value.intValue
-    else error("Int value too big:" + this.value.toString)
+    else this.value.intValue
 
   def +(that: Nat): Nat = new Nat(this.value + that.value)
   def -(that: Nat): Nat = Nat(this.value - that.value)