1  ------------------------------------------------------------------
   2  -- This file was autogenerated by 'writeNumbers', do not modify --
   3  ------------------------------------------------------------------
   4  
   5  package frost.core
   6  
   7  uses frost.unsafe.Pointer
   8  
   9  ===
  10  an unsigned 32 or 64 bit integer, as appropriate for the target architecture.
  11  ===
  12  class UInt : Value, HashKey<UInt>, Comparable<UInt>, Formattable {
  13      @private
  14      class Bits : ListView<Bit> {
  15          def value:UInt
  16          init(value:UInt) {
  17              self.value := value
  18          }
  19  
  20          ===Returns a single bit from this number, where index 0 is the least significant bit.===
  21          @override
  22          function [](index:Int):Bit {
  23              return value && (1 << index) != 0
  24          }
  25  
  26          ===
  27          Returns the number of bits in this integer.
  28          ===
  29          @override
  30          function get_count():Int {
  31              return $int_size
  32          }
  33  
  34          @override
  35          function get_iterator():Iterator<Bit> {
  36              return org.frostlang.frost.IntBitIterator(value.toUInt64, 1 << ($int_size->builtin_uint64 - 1))
  37          }
  38      }
  39      ===
  40      The smallest value this type can hold.
  41      ===
  42      constant MIN:UInt := 0
  43  
  44      ===
  45      The largest value this type can hold.
  46      ===
  47      constant MAX:UInt := (-1).asUInt
  48  
  49      @package
  50      def value:builtin_uint
  51  
  52      ===@hidden===
  53      @implicit
  54      init(value:builtin_uint) {
  55          self.value := value
  56      }
  57  
  58      ===@hidden===
  59      @implicit
  60      @priority(-5)
  61      init(value:UInt8) {
  62          self.value := value.value->builtin_uint
  63      }
  64  
  65      ===@hidden===
  66      @implicit
  67      @priority(-4)
  68      init(value:UInt16) {
  69          self.value := value.value->builtin_uint
  70      }
  71  
  72      ===Adds another number to this number.===
  73      @priority(13)
  74      function +(other:Int32):Int64 {
  75          return value->builtin_int64 + other.value->builtin_int64
  76      }
  77  
  78      ===Adds another number to this number.===
  79      @priority(17)
  80      function +(other:Int):Int64 {
  81          return value->builtin_int64 + other.value->builtin_int64
  82      }
  83  
  84      ===Adds another number to this number.===
  85      @priority(12)
  86      function +(other:UInt32):UInt32 {
  87          return value->builtin_uint32 + other.value
  88      }
  89  
  90      ===Adds another number to this number.===
  91      @priority(14)
  92      function +(other:UInt64):UInt64 {
  93          return value->builtin_uint64 + other.value
  94      }
  95  
  96      ===Adds another number to this number.===
  97      @priority(20)
  98      function +(other:UInt):UInt {
  99          return value + other.value
 100      }
 101  
 102      ===Adds another number to this number without checking for overflow.===
 103      @priority(13)
 104      function +&(other:Int32):Int64 {
 105          return value->builtin_int64 +& other.value->builtin_int64
 106      }
 107  
 108      ===Adds another number to this number without checking for overflow.===
 109      @priority(17)
 110      function +&(other:Int):Int64 {
 111          return value->builtin_int64 +& other.value->builtin_int64
 112      }
 113  
 114      ===Adds another number to this number without checking for overflow.===
 115      @priority(12)
 116      function +&(other:UInt32):UInt32 {
 117          return value->builtin_uint32 +& other.value
 118      }
 119  
 120      ===Adds another number to this number without checking for overflow.===
 121      @priority(14)
 122      function +&(other:UInt64):UInt64 {
 123          return value->builtin_uint64 +& other.value
 124      }
 125  
 126      ===Adds another number to this number without checking for overflow.===
 127      @priority(20)
 128      function +&(other:UInt):UInt {
 129          return value +& other.value
 130      }
 131  
 132      ===Subtracts another number from this number.===
 133      @priority(13)
 134      function -(other:Int32):Int64 {
 135          return value->builtin_int64 - other.value->builtin_int64
 136      }
 137  
 138      ===Subtracts another number from this number.===
 139      @priority(17)
 140      function -(other:Int):Int64 {
 141          return value->builtin_int64 - other.value->builtin_int64
 142      }
 143  
 144      ===Subtracts another number from this number.===
 145      @priority(12)
 146      function -(other:UInt32):UInt32 {
 147          return value->builtin_uint32 - other.value
 148      }
 149  
 150      ===Subtracts another number from this number.===
 151      @priority(14)
 152      function -(other:UInt64):UInt64 {
 153          return value->builtin_uint64 - other.value
 154      }
 155  
 156      ===Subtracts another number from this number.===
 157      @priority(20)
 158      function -(other:UInt):UInt {
 159          return value - other.value
 160      }
 161  
 162      ===Subtracts another number from this number without checking for overflow.===
 163      @priority(13)
 164      function -&(other:Int32):Int64 {
 165          return value->builtin_int64 -& other.value->builtin_int64
 166      }
 167  
 168      ===Subtracts another number from this number without checking for overflow.===
 169      @priority(17)
 170      function -&(other:Int):Int64 {
 171          return value->builtin_int64 -& other.value->builtin_int64
 172      }
 173  
 174      ===Subtracts another number from this number without checking for overflow.===
 175      @priority(12)
 176      function -&(other:UInt32):UInt32 {
 177          return value->builtin_uint32 -& other.value
 178      }
 179  
 180      ===Subtracts another number from this number without checking for overflow.===
 181      @priority(14)
 182      function -&(other:UInt64):UInt64 {
 183          return value->builtin_uint64 -& other.value
 184      }
 185  
 186      ===Subtracts another number from this number without checking for overflow.===
 187      @priority(20)
 188      function -&(other:UInt):UInt {
 189          return value -& other.value
 190      }
 191  
 192      ===Returns the negation (additive inverse) of this number===
 193      function -():UInt {
 194          return UInt(-value)
 195      }
 196  
 197      ===Multiplies this number by another number.===
 198      @priority(13)
 199      function *(other:Int32):Int64 {
 200          return value->builtin_int64 * other.value->builtin_int64
 201      }
 202  
 203      ===Multiplies this number by another number.===
 204      @priority(17)
 205      function *(other:Int):Int64 {
 206          return value->builtin_int64 * other.value->builtin_int64
 207      }
 208  
 209      ===Multiplies this number by another number.===
 210      @priority(12)
 211      function *(other:UInt32):UInt32 {
 212          return value->builtin_uint32 * other.value
 213      }
 214  
 215      ===Multiplies this number by another number.===
 216      @priority(14)
 217      function *(other:UInt64):UInt64 {
 218          return value->builtin_uint64 * other.value
 219      }
 220  
 221      ===Multiplies this number by another number.===
 222      @priority(20)
 223      function *(other:UInt):UInt {
 224          return value * other.value
 225      }
 226  
 227      ===Multiplies this number by another number without checking for overflow.===
 228      @priority(13)
 229      function *&(other:Int32):Int64 {
 230          return value->builtin_int64 *& other.value->builtin_int64
 231      }
 232  
 233      ===Multiplies this number by another number without checking for overflow.===
 234      @priority(17)
 235      function *&(other:Int):Int64 {
 236          return value->builtin_int64 *& other.value->builtin_int64
 237      }
 238  
 239      ===Multiplies this number by another number without checking for overflow.===
 240      @priority(12)
 241      function *&(other:UInt32):UInt32 {
 242          return value->builtin_uint32 *& other.value
 243      }
 244  
 245      ===Multiplies this number by another number without checking for overflow.===
 246      @priority(14)
 247      function *&(other:UInt64):UInt64 {
 248          return value->builtin_uint64 *& other.value
 249      }
 250  
 251      ===Multiplies this number by another number without checking for overflow.===
 252      @priority(20)
 253      function *&(other:UInt):UInt {
 254          return value *& other.value
 255      }
 256  
 257      ===Divides this number by another number, returning the whole number portion.===
 258      @priority(13)
 259      function //(other:Int32):Int64 {
 260          return value->builtin_int64 // other.value->builtin_int64
 261      }
 262  
 263      ===Divides this number by another number, returning the whole number portion.===
 264      @priority(17)
 265      function //(other:Int):Int64 {
 266          return value->builtin_int64 // other.value->builtin_int64
 267      }
 268  
 269      ===Divides this number by another number, returning the whole number portion.===
 270      @priority(12)
 271      function //(other:UInt32):UInt32 {
 272          return value->builtin_uint32 // other.value
 273      }
 274  
 275      ===Divides this number by another number, returning the whole number portion.===
 276      @priority(14)
 277      function //(other:UInt64):UInt64 {
 278          return value->builtin_uint64 // other.value
 279      }
 280  
 281      ===Divides this number by another number, returning the whole number portion.===
 282      @priority(20)
 283      function //(other:UInt):UInt {
 284          return value // other.value
 285      }
 286  
 287      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 288      @priority(13)
 289      function //&(other:Int32):Int64 {
 290          return value->builtin_int64 //& other.value->builtin_int64
 291      }
 292  
 293      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 294      @priority(17)
 295      function //&(other:Int):Int64 {
 296          return value->builtin_int64 //& other.value->builtin_int64
 297      }
 298  
 299      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 300      @priority(12)
 301      function //&(other:UInt32):UInt32 {
 302          return value->builtin_uint32 //& other.value
 303      }
 304  
 305      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 306      @priority(14)
 307      function //&(other:UInt64):UInt64 {
 308          return value->builtin_uint64 //& other.value
 309      }
 310  
 311      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 312      @priority(20)
 313      function //&(other:UInt):UInt {
 314          return value //& other.value
 315      }
 316  
 317      ===Returns the remainder of dividing this number by another number.===
 318      @priority(13)
 319      function %(other:Int32):Int64 {
 320          return value->builtin_int64 % other.value->builtin_int64
 321      }
 322  
 323      ===Returns the remainder of dividing this number by another number.===
 324      @priority(17)
 325      function %(other:Int):Int64 {
 326          return value->builtin_int64 % other.value->builtin_int64
 327      }
 328  
 329      ===Returns the remainder of dividing this number by another number.===
 330      @priority(12)
 331      function %(other:UInt32):UInt32 {
 332          return value->builtin_uint32 % other.value
 333      }
 334  
 335      ===Returns the remainder of dividing this number by another number.===
 336      @priority(14)
 337      function %(other:UInt64):UInt64 {
 338          return value->builtin_uint64 % other.value
 339      }
 340  
 341      ===Returns the remainder of dividing this number by another number.===
 342      @priority(20)
 343      function %(other:UInt):UInt {
 344          return value % other.value
 345      }
 346  
 347      ===Divides this number by another number.===
 348      @priority(9)
 349      function /(other:Int8):Real32 {
 350          return value->builtin_float32 / other.value->builtin_float32
 351      }
 352  
 353      ===Divides this number by another number.===
 354      @priority(11)
 355      function /(other:Int16):Real32 {
 356          return value->builtin_float32 / other.value->builtin_float32
 357      }
 358  
 359      ===Divides this number by another number.===
 360      @priority(13)
 361      function /(other:Int32):Real32 {
 362          return value->builtin_float32 / other.value->builtin_float32
 363      }
 364  
 365      ===Divides this number by another number.===
 366      @priority(15)
 367      function /(other:Int64):Real64 {
 368          return value->builtin_float64 / other.value->builtin_float64
 369      }
 370  
 371      ===Divides this number by another number.===
 372      @priority(8)
 373      function /(other:UInt8):Real32 {
 374          return value->builtin_float32 / other.value->builtin_float32
 375      }
 376  
 377      ===Divides this number by another number.===
 378      @priority(10)
 379      function /(other:UInt16):Real32 {
 380          return value->builtin_float32 / other.value->builtin_float32
 381      }
 382  
 383      ===Divides this number by another number.===
 384      @priority(12)
 385      function /(other:UInt32):Real32 {
 386          return value->builtin_float32 / other.value->builtin_float32
 387      }
 388  
 389      ===Divides this number by another number.===
 390      @priority(14)
 391      function /(other:UInt64):Real64 {
 392          return value->builtin_float64 / other.value->builtin_float64
 393      }
 394  
 395      ===Divides this number by another number.===
 396      @priority(18)
 397      function /(other:Real32):Real32 {
 398          return value->builtin_float32 / other.value
 399      }
 400  
 401      ===Divides this number by another number.===
 402      @priority(19)
 403      function /(other:Real64):Real64 {
 404          return value->builtin_float64 / other.value
 405      }
 406  
 407      ===Returns the bitwise NOT of this number.===
 408      function !!():UInt {
 409          return UInt(!!value)
 410      }
 411  
 412      ===Returns the bitwise AND of this number with another number.===
 413      @priority(13)
 414      function &&(other:Int32):Int32 {
 415          return value->builtin_int32 && other.value
 416      }
 417  
 418      ===Returns the bitwise AND of this number with another number.===
 419      @priority(15)
 420      function &&(other:Int64):Int64 {
 421          return value->builtin_int64 && other.value
 422      }
 423  
 424      ===Returns the bitwise AND of this number with another number.===
 425      @priority(17)
 426      function &&(other:Int):Int {
 427          return value->builtin_int && other.value
 428      }
 429  
 430      ===Returns the bitwise AND of this number with another number.===
 431      @priority(12)
 432      function &&(other:UInt32):UInt32 {
 433          return value->builtin_uint32 && other.value
 434      }
 435  
 436      ===Returns the bitwise AND of this number with another number.===
 437      @priority(14)
 438      function &&(other:UInt64):UInt64 {
 439          return value->builtin_uint64 && other.value
 440      }
 441  
 442      ===Returns the bitwise AND of this number with another number.===
 443      @priority(20)
 444      function &&(other:UInt):UInt {
 445          return value && other.value
 446      }
 447  
 448      ===Returns the bitwise OR of this number with another number.===
 449      @priority(13)
 450      function ||(other:Int32):Int32 {
 451          return value->builtin_int32 || other.value
 452      }
 453  
 454      ===Returns the bitwise OR of this number with another number.===
 455      @priority(15)
 456      function ||(other:Int64):Int64 {
 457          return value->builtin_int64 || other.value
 458      }
 459  
 460      ===Returns the bitwise OR of this number with another number.===
 461      @priority(17)
 462      function ||(other:Int):Int {
 463          return value->builtin_int || other.value
 464      }
 465  
 466      ===Returns the bitwise OR of this number with another number.===
 467      @priority(12)
 468      function ||(other:UInt32):UInt32 {
 469          return value->builtin_uint32 || other.value
 470      }
 471  
 472      ===Returns the bitwise OR of this number with another number.===
 473      @priority(14)
 474      function ||(other:UInt64):UInt64 {
 475          return value->builtin_uint64 || other.value
 476      }
 477  
 478      ===Returns the bitwise OR of this number with another number.===
 479      @priority(20)
 480      function ||(other:UInt):UInt {
 481          return value || other.value
 482      }
 483  
 484      ===Returns the bitwise XOR of this number with another number.===
 485      @priority(13)
 486      function ~~(other:Int32):Int32 {
 487          return value->builtin_int32 ~~ other.value
 488      }
 489  
 490      ===Returns the bitwise XOR of this number with another number.===
 491      @priority(15)
 492      function ~~(other:Int64):Int64 {
 493          return value->builtin_int64 ~~ other.value
 494      }
 495  
 496      ===Returns the bitwise XOR of this number with another number.===
 497      @priority(17)
 498      function ~~(other:Int):Int {
 499          return value->builtin_int ~~ other.value
 500      }
 501  
 502      ===Returns the bitwise XOR of this number with another number.===
 503      @priority(12)
 504      function ~~(other:UInt32):UInt32 {
 505          return value->builtin_uint32 ~~ other.value
 506      }
 507  
 508      ===Returns the bitwise XOR of this number with another number.===
 509      @priority(14)
 510      function ~~(other:UInt64):UInt64 {
 511          return value->builtin_uint64 ~~ other.value
 512      }
 513  
 514      ===Returns the bitwise XOR of this number with another number.===
 515      @priority(20)
 516      function ~~(other:UInt):UInt {
 517          return value ~~ other.value
 518      }
 519  
 520      ===Returns this number shifted left by the specified number of bits.===
 521      @priority(20)
 522      function <<(other:UInt):UInt {
 523          return value << other.value
 524      }
 525  
 526      ===Returns this number shifted left by the specified number of bits, without checking for overflow.===
 527      @priority(20)
 528      function <<&(other:UInt):UInt {
 529          return value <<& other.value
 530      }
 531  
 532      ===Returns this number logical shifted right by the specified number of bits.===
 533      @priority(20)
 534      function >>(other:UInt):UInt {
 535          return value >> other.value
 536      }
 537  
 538      ===Returns `true` if this number is equal to the given number.===
 539      @priority(9)
 540      function =(other:Int8):Bit {
 541          return value->builtin_int64 = other.value->builtin_int64
 542      }
 543  
 544      ===Returns `true` if this number is equal to the given number.===
 545      @priority(11)
 546      function =(other:Int16):Bit {
 547          return value->builtin_int64 = other.value->builtin_int64
 548      }
 549  
 550      ===Returns `true` if this number is equal to the given number.===
 551      @priority(13)
 552      function =(other:Int32):Bit {
 553          return value->builtin_int64 = other.value->builtin_int64
 554      }
 555  
 556      ===Returns `true` if this number is equal to the given number.===
 557      @priority(17)
 558      function =(other:Int):Bit {
 559          return value->builtin_int64 = other.value->builtin_int64
 560      }
 561  
 562      ===Returns `true` if this number is equal to the given number.===
 563      @priority(8)
 564      function =(other:UInt8):Bit {
 565          return value = other.value->builtin_uint
 566      }
 567  
 568      ===Returns `true` if this number is equal to the given number.===
 569      @priority(10)
 570      function =(other:UInt16):Bit {
 571          return value = other.value->builtin_uint
 572      }
 573  
 574      ===Returns `true` if this number is equal to the given number.===
 575      @priority(12)
 576      function =(other:UInt32):Bit {
 577          return value->builtin_uint32 = other.value
 578      }
 579  
 580      ===Returns `true` if this number is equal to the given number.===
 581      @priority(14)
 582      function =(other:UInt64):Bit {
 583          return value->builtin_uint64 = other.value
 584      }
 585  
 586      ===Returns `true` if this number is equal to the given number.===
 587      @override
 588      @priority(20)
 589      function =(other:UInt):Bit {
 590          return value = other.value
 591      }
 592  
 593      ===Returns `true` if this number is not equal to the given number.===
 594      @priority(9)
 595      function !=(other:Int8):Bit {
 596          return value->builtin_int64 != other.value->builtin_int64
 597      }
 598  
 599      ===Returns `true` if this number is not equal to the given number.===
 600      @priority(11)
 601      function !=(other:Int16):Bit {
 602          return value->builtin_int64 != other.value->builtin_int64
 603      }
 604  
 605      ===Returns `true` if this number is not equal to the given number.===
 606      @priority(13)
 607      function !=(other:Int32):Bit {
 608          return value->builtin_int64 != other.value->builtin_int64
 609      }
 610  
 611      ===Returns `true` if this number is not equal to the given number.===
 612      @priority(17)
 613      function !=(other:Int):Bit {
 614          return value->builtin_int64 != other.value->builtin_int64
 615      }
 616  
 617      ===Returns `true` if this number is not equal to the given number.===
 618      @priority(8)
 619      function !=(other:UInt8):Bit {
 620          return value != other.value->builtin_uint
 621      }
 622  
 623      ===Returns `true` if this number is not equal to the given number.===
 624      @priority(10)
 625      function !=(other:UInt16):Bit {
 626          return value != other.value->builtin_uint
 627      }
 628  
 629      ===Returns `true` if this number is not equal to the given number.===
 630      @priority(12)
 631      function !=(other:UInt32):Bit {
 632          return value->builtin_uint32 != other.value
 633      }
 634  
 635      ===Returns `true` if this number is not equal to the given number.===
 636      @priority(14)
 637      function !=(other:UInt64):Bit {
 638          return value->builtin_uint64 != other.value
 639      }
 640  
 641      ===Returns `true` if this number is not equal to the given number.===
 642      @override
 643      @priority(20)
 644      function !=(other:UInt):Bit {
 645          return value != other.value
 646      }
 647  
 648      ===Returns `true` if this number is less than the given number.===
 649      @priority(9)
 650      function <(other:Int8):Bit {
 651          return value->builtin_int64 < other.value->< other.value->builtin_int64
 652      }
 653  
 654      ===Returns `true` if this number is less than the given number.===
 655      @priority(11)
 656      function <(other:Int16):Bit {
 657          return value->builtin_int64 < other.value->< other.value->builtin_int64
 658      }
 659  
 660      ===Returns `true` if this number is less than the given number.===
 661      @priority(13)
 662      function <(other:Int32):Bit {
 663          return value->builtin_int64 < other.value->< other.value->builtin_int64
 664      }
 665  
 666      ===Returns `true` if this number is less than the given number.===
 667      @priority(17)
 668      function <(other:Int):Bit {
 669          return value->builtin_int64 < other.value->< other.value->builtin_int64
 670      }
 671  
 672      ===Returns `true` if this number is less than the given number.===
 673      @priority(8)
 674      function <(other:UInt8):Bit {
 675          return value < other.value->< other.value->builtin_uint
 676      }
 677  
 678      ===Returns `true` if this number is less than the given number.===
 679      @priority(10)
 680      function <(other:UInt16):Bit {
 681          return value < other.value->< other.value->builtin_uint
 682      }
 683  
 684      ===Returns `true` if this number is less than the given number.===
 685      @priority(12)
 686      function <(other:UInt32):Bit {
 687          return value->builtin_uint32 < other.value
 688      }< other.value
 689      }
 690  
 691      ===Returns `true` if this number is less than the given number.===
 692      @priority(14)
 693      function <(other:UInt64):Bit {
 694          return value->builtin_uint64 < other.value
 695      }< other.value
 696      }
 697  
 698      ===Returns `true` if this number is less than the given number.===
 699      @override
 700      @priority(20)
 701      function <(other:UInt):Bit {
 702          return value < other.value
 703      }< other.value
 704      }
 705  
 706      ===Returns `true` if this number is greater than the given number.===
 707      @priority(9)
 708      function >(other:Int8):Bit {
 709          return value->builtin_int64 > other.value->builtin_int64
 710      }
 711  
 712      ===Returns `true` if this number is greater than the given number.===
 713      @priority(11)
 714      function >(other:Int16):Bit {
 715          return value->builtin_int64 > other.value->builtin_int64
 716      }
 717  
 718      ===Returns `true` if this number is greater than the given number.===
 719      @priority(13)
 720      function >(other:Int32):Bit {
 721          return value->builtin_int64 > other.value->builtin_int64
 722      }
 723  
 724      ===Returns `true` if this number is greater than the given number.===
 725      @priority(17)
 726      function >(other:Int):Bit {
 727          return value->builtin_int64 > other.value->builtin_int64
 728      }
 729  
 730      ===Returns `true` if this number is greater than the given number.===
 731      @priority(8)
 732      function >(other:UInt8):Bit {
 733          return value > other.value->builtin_uint
 734      }
 735  
 736      ===Returns `true` if this number is greater than the given number.===
 737      @priority(10)
 738      function >(other:UInt16):Bit {
 739          return value > other.value->builtin_uint
 740      }
 741  
 742      ===Returns `true` if this number is greater than the given number.===
 743      @priority(12)
 744      function >(other:UInt32):Bit {
 745          return value->builtin_uint32 > other.value
 746      }
 747  
 748      ===Returns `true` if this number is greater than the given number.===
 749      @priority(14)
 750      function >(other:UInt64):Bit {
 751          return value->builtin_uint64 > other.value
 752      }
 753  
 754      ===Returns `true` if this number is greater than the given number.===
 755      @override
 756      @priority(20)
 757      function >(other:UInt):Bit {
 758          return value > other.value
 759      }
 760  
 761      ===Returns `true` if this number is greater than or equal to the given number.===
 762      @priority(9)
 763      function >=(other:Int8):Bit {
 764          return value->builtin_int64 >= other.value->builtin_int64
 765      }
 766  
 767      ===Returns `true` if this number is greater than or equal to the given number.===
 768      @priority(11)
 769      function >=(other:Int16):Bit {
 770          return value->builtin_int64 >= other.value->builtin_int64
 771      }
 772  
 773      ===Returns `true` if this number is greater than or equal to the given number.===
 774      @priority(13)
 775      function >=(other:Int32):Bit {
 776          return value->builtin_int64 >= other.value->builtin_int64
 777      }
 778  
 779      ===Returns `true` if this number is greater than or equal to the given number.===
 780      @priority(17)
 781      function >=(other:Int):Bit {
 782          return value->builtin_int64 >= other.value->builtin_int64
 783      }
 784  
 785      ===Returns `true` if this number is greater than or equal to the given number.===
 786      @priority(8)
 787      function >=(other:UInt8):Bit {
 788          return value >= other.value->builtin_uint
 789      }
 790  
 791      ===Returns `true` if this number is greater than or equal to the given number.===
 792      @priority(10)
 793      function >=(other:UInt16):Bit {
 794          return value >= other.value->builtin_uint
 795      }
 796  
 797      ===Returns `true` if this number is greater than or equal to the given number.===
 798      @priority(12)
 799      function >=(other:UInt32):Bit {
 800          return value->builtin_uint32 >= other.value
 801      }
 802  
 803      ===Returns `true` if this number is greater than or equal to the given number.===
 804      @priority(14)
 805      function >=(other:UInt64):Bit {
 806          return value->builtin_uint64 >= other.value
 807      }
 808  
 809      ===Returns `true` if this number is greater than or equal to the given number.===
 810      @override
 811      @priority(20)
 812      function >=(other:UInt):Bit {
 813          return value >= other.value
 814      }
 815  
 816      ===Returns `true` if this number is less than or equal to the given number.===
 817      @priority(9)
 818      function <=(other:Int8):Bit {
 819          return value->builtin_int64 <= other.value->builtin_int64
 820      }
 821  
 822      ===Returns `true` if this number is less than or equal to the given number.===
 823      @priority(11)
 824      function <=(other:Int16):Bit {
 825          return value->builtin_int64 <= other.value->builtin_int64
 826      }
 827  
 828      ===Returns `true` if this number is less than or equal to the given number.===
 829      @priority(13)
 830      function <=(other:Int32):Bit {
 831          return value->builtin_int64 <= other.value->builtin_int64
 832      }
 833  
 834      ===Returns `true` if this number is less than or equal to the given number.===
 835      @priority(17)
 836      function <=(other:Int):Bit {
 837          return value->builtin_int64 <= other.value->builtin_int64
 838      }
 839  
 840      ===Returns `true` if this number is less than or equal to the given number.===
 841      @priority(8)
 842      function <=(other:UInt8):Bit {
 843          return value <= other.value->builtin_uint
 844      }
 845  
 846      ===Returns `true` if this number is less than or equal to the given number.===
 847      @priority(10)
 848      function <=(other:UInt16):Bit {
 849          return value <= other.value->builtin_uint
 850      }
 851  
 852      ===Returns `true` if this number is less than or equal to the given number.===
 853      @priority(12)
 854      function <=(other:UInt32):Bit {
 855          return value->builtin_uint32 <= other.value
 856      }
 857  
 858      ===Returns `true` if this number is less than or equal to the given number.===
 859      @priority(14)
 860      function <=(other:UInt64):Bit {
 861          return value->builtin_uint64 <= other.value
 862      }
 863  
 864      ===Returns `true` if this number is less than or equal to the given number.===
 865      @override
 866      @priority(20)
 867      function <=(other:UInt):Bit {
 868          return value <= other.value
 869      }
 870      ===Returns a list of all integers in the given range. The list is 'lazy', meaning that it does not actually allocate memory to hold the entire list.===
 871      @class
 872      function [](range:Range<UInt>):ListView<UInt> {
 873          return org.frostlang.frost.UIntList(SteppedRange<UInt, UInt>(range.min, range.max, 1, range.inclusive))
 874      }
 875      ===Returns a list of all integers in the given stepped range. The list is 'lazy', meaning that it does not actually allocate memory to hold the entire list.===
 876      @class
 877      function [](range:SteppedRange<UInt, UInt>):ListView<UInt> {
 878          return org.frostlang.frost.UIntList(range)
 879      }
 880      ===
 881      A view of this number as a collection of bits, with `bits[0]` as the least significant bit.
 882      ===
 883      property bits:ListView<Bit>
 884      function get_bits():ListView<Bit> { return Bits(self) }
 885  
 886      ===The square root of this number.===
 887      property sqrt:Real64
 888      function get_sqrt():Real64 {
 889          return toReal64.sqrt
 890      }
 891  
 892      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 893      @priority(9)
 894      function min(other:Int8):Int64 {
 895          if value->builtin_int64 < other.value->< other.value->builtin_int64 {
 896              return value->builtin_int64
 897          }
 898          return other.value->builtin_int64
 899      }
 900  
 901      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 902      @priority(11)
 903      function min(other:Int16):Int64 {
 904          if value->builtin_int64 < other.value->< other.value->builtin_int64 {
 905              return value->builtin_int64
 906          }
 907          return other.value->builtin_int64
 908      }
 909  
 910      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 911      @priority(13)
 912      function min(other:Int32):Int64 {
 913          if value->builtin_int64 < other.value->< other.value->builtin_int64 {
 914              return value->builtin_int64
 915          }
 916          return other.value->builtin_int64
 917      }
 918  
 919  
 920      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 921      @priority(17)
 922      function min(other:Int):Int64 {
 923          if value->builtin_int64 < other.value->< other.value->builtin_int64 {
 924              return value->builtin_int64
 925          }
 926          return other.value->builtin_int64
 927      }
 928  
 929      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 930      @priority(8)
 931      function min(other:UInt8):UInt {
 932          if value < other.value->< other.value->builtin_uint {
 933              return value
 934          }
 935          return other.value->builtin_uint
 936      }
 937  
 938      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 939      @priority(10)
 940      function min(other:UInt16):UInt {
 941          if value < other.value->< other.value->builtin_uint {
 942              return value
 943          }
 944          return other.value->builtin_uint
 945      }
 946  
 947      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 948      @priority(12)
 949      function min(other:UInt32):UInt32 {
 950          if value->builtin_uint32 < other.value {< other.value {
 951              return value->builtin_uint32
 952          }
 953          return other.value
 954      }
 955  
 956      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 957      @priority(14)
 958      function min(other:UInt64):UInt64 {
 959          if value->builtin_uint64 < other.value {< other.value {
 960              return value->builtin_uint64
 961          }
 962          return other.value
 963      }
 964  
 965      ===Returns the smaller (closest to negative infinity) of this number and another number.===
 966      @priority(20)
 967      function min(other:UInt):UInt {
 968          if value < other.value {< other.value {
 969              return value
 970          }
 971          return other.value
 972      }
 973  
 974      ===Returns the larger (closest to positive infinity) of this number and another number.===
 975      @priority(9)
 976      function max(other:Int8):Int64 {
 977          if value->builtin_int64 > other.value->builtin_int64 {
 978              return value->builtin_int64
 979          }
 980          return other.value->builtin_int64
 981      }
 982  
 983      ===Returns the larger (closest to positive infinity) of this number and another number.===
 984      @priority(11)
 985      function max(other:Int16):Int64 {
 986          if value->builtin_int64 > other.value->builtin_int64 {
 987              return value->builtin_int64
 988          }
 989          return other.value->builtin_int64
 990      }
 991  
 992      ===Returns the larger (closest to positive infinity) of this number and another number.===
 993      @priority(13)
 994      function max(other:Int32):Int64 {
 995          if value->builtin_int64 > other.value->builtin_int64 {
 996              return value->builtin_int64
 997          }
 998          return other.value->builtin_int64
 999      }
1000  
1001  
1002      ===Returns the larger (closest to positive infinity) of this number and another number.===
1003      @priority(17)
1004      function max(other:Int):Int64 {
1005          if value->builtin_int64 > other.value->builtin_int64 {
1006              return value->builtin_int64
1007          }
1008          return other.value->builtin_int64
1009      }
1010  
1011      ===Returns the larger (closest to positive infinity) of this number and another number.===
1012      @priority(8)
1013      function max(other:UInt8):UInt {
1014          if value > other.value->builtin_uint {
1015              return value
1016          }
1017          return other.value->builtin_uint
1018      }
1019  
1020      ===Returns the larger (closest to positive infinity) of this number and another number.===
1021      @priority(10)
1022      function max(other:UInt16):UInt {
1023          if value > other.value->builtin_uint {
1024              return value
1025          }
1026          return other.value->builtin_uint
1027      }
1028  
1029      ===Returns the larger (closest to positive infinity) of this number and another number.===
1030      @priority(12)
1031      function max(other:UInt32):UInt32 {
1032          if value->builtin_uint32 > other.value {
1033              return value->builtin_uint32
1034          }
1035          return other.value
1036      }
1037  
1038      ===Returns the larger (closest to positive infinity) of this number and another number.===
1039      @priority(14)
1040      function max(other:UInt64):UInt64 {
1041          if value->builtin_uint64 > other.value {
1042              return value->builtin_uint64
1043          }
1044          return other.value
1045      }
1046  
1047      ===Returns the larger (closest to positive infinity) of this number and another number.===
1048      @priority(20)
1049      function max(other:UInt):UInt {
1050          if value > other.value {
1051              return value
1052          }
1053          return other.value
1054      }
1055  
1056      @override
1057      function get_hash():Int {
1058          return Int(value->builtin_int)
1059      }
1060  
1061      ===The number of `1` bits in this number's binary representation.===
1062      property bitCount:UInt
1063      @external(frostUInt_get_bitCount)
1064      function get_bitCount():UInt
1065  
1066      ===Parses a string as a number in the specified radix. Returns `null` if the parse fails.===
1067      @class
1068      @pre(radix >= 2 & radix <= 36)
1069      function parse(str:String, radix:Int):UInt? {
1070          def result := Frost.parse(str, radix)
1071          if result == null {
1072              return null
1073          }
1074          return result.asUInt
1075      }
1076  
1077      ===
1078      This number converted to an Int.
1079      If this number is not in the range of an Int, a safety violation occurs.
1080      ===
1081      property asInt:Int
1082      function get_asInt():Int {
1083      assert self <= Int.MAX.toUInt, "UInt(\{self}) cannot be safely converted to Int"
1084          return Int(value->builtin_int)
1085      }
1086  
1087      ===
1088      This number converted to an Int.
1089      This function never fails, even if the number is not in the range of an Int.
1090      ===
1091      property toInt:Int
1092      function get_toInt():Int {
1093          return Int(value->builtin_int)
1094      }
1095  
1096      ===
1097      This number converted to an 8 bit signed number.
1098      If this number is not in the range of an 8 bit signed number, a safety violation occurs.
1099      ===
1100      property asInt8:Int8
1101      function get_asInt8():Int8 {
1102      assert self <= Int8.MAX.toUInt, "UInt(\{self}) cannot be safely converted to Int8"
1103          return Int8(value->builtin_int8)
1104      }
1105  
1106      ===
1107      This number converted to an 8 bit signed number.
1108      This function never fails, even if the number is not in the range of an 8 bit signed number.
1109      ===
1110      property toInt8:Int8
1111      function get_toInt8():Int8 {
1112          return Int8(value->builtin_int8)
1113      }
1114  
1115      ===
1116      This number converted to a 16 bit signed number.
1117      If this number is not in the range of a 16 bit signed number, a safety violation occurs.
1118      ===
1119      property asInt16:Int16
1120      function get_asInt16():Int16 {
1121      assert self <= Int16.MAX.toUInt, "UInt(\{self}) cannot be safely converted to Int16"
1122          return Int16(value->builtin_int16)
1123      }
1124  
1125      ===
1126      This number converted to a 16 bit signed number.
1127      This function never fails, even if the number is not in the range of a 16 bit signed number.
1128      ===
1129      property toInt16:Int16
1130      function get_toInt16():Int16 {
1131          return Int16(value->builtin_int16)
1132      }
1133  
1134      ===
1135      This number converted to a 32 bit signed number.
1136      If this number is not in the range of a 32 bit signed number, a safety violation occurs.
1137      ===
1138      property asInt32:Int32
1139      function get_asInt32():Int32 {
1140      assert self <= Int32.MAX.toUInt, "UInt(\{self}) cannot be safely converted to Int32"
1141          return Int32(value->builtin_int32)
1142      }
1143  
1144      ===
1145      This number converted to a 32 bit signed number.
1146      This function never fails, even if the number is not in the range of a 32 bit signed number.
1147      ===
1148      property toInt32:Int32
1149      function get_toInt32():Int32 {
1150          return Int32(value->builtin_int32)
1151      }
1152  
1153      ===
1154      This number converted to a 64 bit signed number.
1155      If this number is not in the range of a 64 bit signed number, a safety violation occurs.
1156      ===
1157      property asInt64:Int64
1158      function get_asInt64():Int64 {
1159      assert self.toUInt64 <= Int64.MAX.toUInt64, "UInt(\{self}) cannot be safely converted to Int64"
1160          return Int64(value->builtin_int64)
1161      }
1162  
1163      ===
1164      This number converted to a 64 bit signed number.
1165      This function never fails, even if the number is not in the range of a 64 bit signed number.
1166      ===
1167      property toInt64:Int64
1168      function get_toInt64():Int64 {
1169          return Int64(value->builtin_int64)
1170      }
1171  
1172      ===
1173      This number converted to an 8 bit unsigned number.
1174      If this number is not in the range of an 8 bit unsigned number, a safety violation occurs.
1175      ===
1176      property asUInt8:UInt8
1177      function get_asUInt8():UInt8 {
1178      assert self <= UInt8.MAX.toUInt, "UInt(\{self}) cannot be safely converted to UInt8"
1179          return UInt8(value->builtin_uint8)
1180      }
1181  
1182      ===
1183      This number converted to an 8 bit unsigned number.
1184      This function never fails, even if the number is not in the range of an 8 bit unsigned number.
1185      ===
1186      property toUInt8:UInt8
1187      function get_toUInt8():UInt8 {
1188          return UInt8(value->builtin_uint8)
1189      }
1190  
1191      ===
1192      This number converted to a 16 bit unsigned number.
1193      If this number is not in the range of a 16 bit unsigned number, a safety violation occurs.
1194      ===
1195      property asUInt16:UInt16
1196      function get_asUInt16():UInt16 {
1197      assert self <= UInt16.MAX.toUInt, "UInt(\{self}) cannot be safely converted to UInt16"
1198          return UInt16(value->builtin_uint16)
1199      }
1200  
1201      ===
1202      This number converted to a 16 bit unsigned number.
1203      This function never fails, even if the number is not in the range of a 16 bit unsigned number.
1204      ===
1205      property toUInt16:UInt16
1206      function get_toUInt16():UInt16 {
1207          return UInt16(value->builtin_uint16)
1208      }
1209  
1210      ===
1211      This number converted to a 32 bit unsigned number.
1212      If this number is not in the range of a 32 bit unsigned number, a safety violation occurs.
1213      ===
1214      property asUInt32:UInt32
1215      function get_asUInt32():UInt32 {
1216      assert self <= UInt32.MAX.toUInt, "UInt(\{self}) cannot be safely converted to UInt32"
1217          return UInt32(value->builtin_uint32)
1218      }
1219  
1220      ===
1221      This number converted to a 32 bit unsigned number.
1222      This function never fails, even if the number is not in the range of a 32 bit unsigned number.
1223      ===
1224      property toUInt32:UInt32
1225      function get_toUInt32():UInt32 {
1226          return UInt32(value->builtin_uint32)
1227      }
1228  
1229      ===
1230      This number converted to a 64 bit unsigned number.
1231      ===
1232      property asUInt64:UInt64
1233      function get_asUInt64():UInt64 {
1234          return UInt64(value->builtin_uint64)
1235      }
1236  
1237      ===
1238      This number converted to a 64 bit unsigned number.
1239      ===
1240      property toUInt64:UInt64
1241      function get_toUInt64():UInt64 {
1242          return UInt64(value->builtin_uint64)
1243      }
1244  
1245      ===
1246      This number converted to a 32 bit floating point number.
1247      ===
1248      property asReal32:Real32
1249      function get_asReal32():Real32 {
1250          return Real32(value->builtin_float32)
1251      }
1252  
1253      ===
1254      This number converted to a 32 bit floating point number.
1255      ===
1256      property toReal32:Real32
1257      function get_toReal32():Real32 {
1258          return Real32(value->builtin_float32)
1259      }
1260  
1261      ===
1262      This number converted to a 64 bit floating point number.
1263      ===
1264      property asReal64:Real64
1265      function get_asReal64():Real64 {
1266          return Real64(value->builtin_float64)
1267      }
1268  
1269      ===
1270      This number converted to a 64 bit floating point number.
1271      ===
1272      property toReal64:Real64
1273      function get_toReal64():Real64 {
1274          return Real64(value->builtin_float64)
1275      }
1276  
1277      ===Returns this number converted to a decimal string.===
1278      @override
1279      function get_toString():String {
1280          constant max := 20
1281          def chars := Pointer<Char8>.alloc(max)
1282          var index := max - 1
1283          var value := self
1284          if value >= 0 {
1285              do {
1286                  chars[index] := Char8((value % 10 + 48).asUInt8)
1287                  value := (value // 10)
1288                  index -= 1
1289              }
1290              while value > 0
1291              index += 1
1292          }
1293          else {
1294              do {
1295                  chars[index] := Char8((48 - value % 10).asUInt8)
1296                  value := (value // 10)
1297                  index -= 1
1298              }
1299              while value < 0< 0
1300              chars[index] := "-"
1301          }
1302          def size := max - index
1303          for i in 0 .. size {
1304              chars[i] := chars[i + index]
1305          }
1306          return String(chars, size)
1307      }
1308  
1309      === Returns a formatted representation of this number. Supported format strings are `""`, `"d"`, or `"D"` for decimal, `"b"` or `"B"` for binary, `"o"` or `"O"` for octal, `"x"` for lowercase hexadecimal, and `"X"` for uppercase hexadecimal. ===
1310      @override
1311      function format(fmt:String):String {
1312          return Frost.format(false, self.toUInt64, 0xFFFFFFFFFFFFFFFF, fmt)
1313      }
1314  }
1315