corrected range chec
authorhaftmann
Fri Jul 16 15:28:23 2010 +0200 (2010-07-16)
changeset 378466f8b1bb4d248
parent 37845 b70d7a347964
child 37847 425dd7d97e41
child 37876 48116a1764c5
corrected range chec
src/HOL/Library/Efficient_Nat.thy
     1.1 --- a/src/HOL/Library/Efficient_Nat.thy	Fri Jul 16 15:28:22 2010 +0200
     1.2 +++ b/src/HOL/Library/Efficient_Nat.thy	Fri Jul 16 15:28:23 2010 +0200
     1.3 @@ -312,9 +312,9 @@
     1.4    def equals(that: Nat): Boolean = this.value == that.value
     1.5  
     1.6    def as_BigInt: BigInt = this.value
     1.7 -  def as_Int: Int = if (this.value >= Math.MAX_INT && this.value <= Math.MAX_INT)
     1.8 +  def as_Int: Int = if (this.value >= Math.MIN_INT && this.value <= Math.MAX_INT)
     1.9        this.value.intValue
    1.10 -    else error("Int value too big:" + this.value.toString)
    1.11 +    else this.value.intValue
    1.12  
    1.13    def +(that: Nat): Nat = new Nat(this.value + that.value)
    1.14    def -(that: Nat): Nat = Nat(this.value - that.value)