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 8-bit signed integer.
  11  ===
  12  class Int8 : Value, HashKey<Int8>, Comparable<Int8>, Formattable {
  13      @private
  14      class Bits : ListView<Bit> {
  15          def value:Int8
  16          init(value:Int8) {
  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, which is always 8.
  28          ===
  29          @override
  30          function get_count():Int {
  31              return 8
  32          }
  33  
  34          @override
  35          function get_iterator():Iterator<Bit> {
  36              return org.frostlang.frost.IntBitIterator(value.toUInt64, 1 << (8->builtin_uint64 - 1))
  37          }
  38      }
  39      ===
  40      The smallest value this type can hold (-,128).
  41      ===
  42      constant MIN:Int8 := -128
  43  
  44      ===
  45      The largest value this type can hold (127).
  46      ===
  47      constant MAX:Int8 := 127
  48  
  49      @package
  50      def value:builtin_int8
  51  
  52      ===@hidden===
  53      @implicit
  54      init(value:builtin_int8) {
  55          self.value := value
  56      }
  57  
  58      ===Adds another number to this number.===
  59      @priority(20)
  60      function +(other:Int8):Int32 {
  61          return value->builtin_int32 + other.value->builtin_int32
  62      }
  63      ===Adds another number to this number.===
  64      @priority(-1)
  65      function +(other:Int8):Int8 {
  66          return value + other.value
  67      }
  68  
  69      ===Adds another number to this number.===
  70      @priority(4)
  71      function +(other:Int16):Int32 {
  72          return value->builtin_int32 + other.value->builtin_int32
  73      }
  74  
  75      ===Adds another number to this number.===
  76      @priority(6)
  77      function +(other:Int32):Int32 {
  78          return value->builtin_int32 + other.value
  79      }
  80  
  81      ===Adds another number to this number.===
  82      @priority(8)
  83      function +(other:Int64):Int64 {
  84          return value->builtin_int64 + other.value
  85      }
  86  
  87      ===Adds another number to this number.===
  88      @priority(10)
  89      function +(other:Int):Int {
  90          return value->builtin_int + other.value
  91      }
  92  
  93      ===Adds another number to this number.===
  94      @priority(1)
  95      function +(other:UInt8):Int32 {
  96          return value->builtin_int32 + other.value->builtin_int32
  97      }
  98  
  99      ===Adds another number to this number.===
 100      @priority(3)
 101      function +(other:UInt16):Int32 {
 102          return value->builtin_int32 + other.value->builtin_int32
 103      }
 104  
 105      ===Adds another number to this number.===
 106      @priority(5)
 107      function +(other:UInt32):Int64 {
 108          return value->builtin_int64 + other.value->builtin_int64
 109      }
 110  
 111      ===Adds another number to this number.===
 112      @priority(9)
 113      function +(other:UInt):Int64 {
 114          return value->builtin_int64 + other.value->builtin_int64
 115      }
 116  
 117      ===Adds another number to this number without checking for overflow.===
 118      @priority(20)
 119      function +&(other:Int8):Int32 {
 120          return value->builtin_int32 +& other.value->builtin_int32
 121      }
 122      ===Adds another number to this number without checking for overflow.===
 123      @priority(-1)
 124      function +&(other:Int8):Int8 {
 125          return value +& other.value
 126      }
 127  
 128      ===Adds another number to this number without checking for overflow.===
 129      @priority(4)
 130      function +&(other:Int16):Int32 {
 131          return value->builtin_int32 +& other.value->builtin_int32
 132      }
 133  
 134      ===Adds another number to this number without checking for overflow.===
 135      @priority(6)
 136      function +&(other:Int32):Int32 {
 137          return value->builtin_int32 +& other.value
 138      }
 139  
 140      ===Adds another number to this number without checking for overflow.===
 141      @priority(8)
 142      function +&(other:Int64):Int64 {
 143          return value->builtin_int64 +& other.value
 144      }
 145  
 146      ===Adds another number to this number without checking for overflow.===
 147      @priority(10)
 148      function +&(other:Int):Int {
 149          return value->builtin_int +& other.value
 150      }
 151  
 152      ===Adds another number to this number without checking for overflow.===
 153      @priority(1)
 154      function +&(other:UInt8):Int32 {
 155          return value->builtin_int32 +& other.value->builtin_int32
 156      }
 157  
 158      ===Adds another number to this number without checking for overflow.===
 159      @priority(3)
 160      function +&(other:UInt16):Int32 {
 161          return value->builtin_int32 +& other.value->builtin_int32
 162      }
 163  
 164      ===Adds another number to this number without checking for overflow.===
 165      @priority(5)
 166      function +&(other:UInt32):Int64 {
 167          return value->builtin_int64 +& other.value->builtin_int64
 168      }
 169  
 170      ===Adds another number to this number without checking for overflow.===
 171      @priority(9)
 172      function +&(other:UInt):Int64 {
 173          return value->builtin_int64 +& other.value->builtin_int64
 174      }
 175  
 176      ===Subtracts another number from this number.===
 177      @priority(20)
 178      function -(other:Int8):Int32 {
 179          return value->builtin_int32 - other.value->builtin_int32
 180      }
 181      ===Subtracts another number from this number.===
 182      @priority(-1)
 183      function -(other:Int8):Int8 {
 184          return value - other.value
 185      }
 186  
 187      ===Subtracts another number from this number.===
 188      @priority(4)
 189      function -(other:Int16):Int32 {
 190          return value->builtin_int32 - other.value->builtin_int32
 191      }
 192  
 193      ===Subtracts another number from this number.===
 194      @priority(6)
 195      function -(other:Int32):Int32 {
 196          return value->builtin_int32 - other.value
 197      }
 198  
 199      ===Subtracts another number from this number.===
 200      @priority(8)
 201      function -(other:Int64):Int64 {
 202          return value->builtin_int64 - other.value
 203      }
 204  
 205      ===Subtracts another number from this number.===
 206      @priority(10)
 207      function -(other:Int):Int {
 208          return value->builtin_int - other.value
 209      }
 210  
 211      ===Subtracts another number from this number.===
 212      @priority(1)
 213      function -(other:UInt8):Int32 {
 214          return value->builtin_int32 - other.value->builtin_int32
 215      }
 216  
 217      ===Subtracts another number from this number.===
 218      @priority(3)
 219      function -(other:UInt16):Int32 {
 220          return value->builtin_int32 - other.value->builtin_int32
 221      }
 222  
 223      ===Subtracts another number from this number.===
 224      @priority(5)
 225      function -(other:UInt32):Int64 {
 226          return value->builtin_int64 - other.value->builtin_int64
 227      }
 228  
 229      ===Subtracts another number from this number.===
 230      @priority(9)
 231      function -(other:UInt):Int64 {
 232          return value->builtin_int64 - other.value->builtin_int64
 233      }
 234  
 235      ===Subtracts another number from this number without checking for overflow.===
 236      @priority(20)
 237      function -&(other:Int8):Int32 {
 238          return value->builtin_int32 -& other.value->builtin_int32
 239      }
 240      ===Subtracts another number from this number without checking for overflow.===
 241      @priority(-1)
 242      function -&(other:Int8):Int8 {
 243          return value -& other.value
 244      }
 245  
 246      ===Subtracts another number from this number without checking for overflow.===
 247      @priority(4)
 248      function -&(other:Int16):Int32 {
 249          return value->builtin_int32 -& other.value->builtin_int32
 250      }
 251  
 252      ===Subtracts another number from this number without checking for overflow.===
 253      @priority(6)
 254      function -&(other:Int32):Int32 {
 255          return value->builtin_int32 -& other.value
 256      }
 257  
 258      ===Subtracts another number from this number without checking for overflow.===
 259      @priority(8)
 260      function -&(other:Int64):Int64 {
 261          return value->builtin_int64 -& other.value
 262      }
 263  
 264      ===Subtracts another number from this number without checking for overflow.===
 265      @priority(10)
 266      function -&(other:Int):Int {
 267          return value->builtin_int -& other.value
 268      }
 269  
 270      ===Subtracts another number from this number without checking for overflow.===
 271      @priority(1)
 272      function -&(other:UInt8):Int32 {
 273          return value->builtin_int32 -& other.value->builtin_int32
 274      }
 275  
 276      ===Subtracts another number from this number without checking for overflow.===
 277      @priority(3)
 278      function -&(other:UInt16):Int32 {
 279          return value->builtin_int32 -& other.value->builtin_int32
 280      }
 281  
 282      ===Subtracts another number from this number without checking for overflow.===
 283      @priority(5)
 284      function -&(other:UInt32):Int64 {
 285          return value->builtin_int64 -& other.value->builtin_int64
 286      }
 287  
 288      ===Subtracts another number from this number without checking for overflow.===
 289      @priority(9)
 290      function -&(other:UInt):Int64 {
 291          return value->builtin_int64 -& other.value->builtin_int64
 292      }
 293  
 294      ===Returns the negation (additive inverse) of this number===
 295      function -():Int8 {
 296          return Int8(-value)
 297      }
 298  
 299      ===Multiplies this number by another number.===
 300      @priority(20)
 301      function *(other:Int8):Int32 {
 302          return value->builtin_int32 * other.value->builtin_int32
 303      }
 304      ===Multiplies this number by another number.===
 305      @priority(-1)
 306      function *(other:Int8):Int8 {
 307          return value * other.value
 308      }
 309  
 310      ===Multiplies this number by another number.===
 311      @priority(4)
 312      function *(other:Int16):Int32 {
 313          return value->builtin_int32 * other.value->builtin_int32
 314      }
 315  
 316      ===Multiplies this number by another number.===
 317      @priority(6)
 318      function *(other:Int32):Int32 {
 319          return value->builtin_int32 * other.value
 320      }
 321  
 322      ===Multiplies this number by another number.===
 323      @priority(8)
 324      function *(other:Int64):Int64 {
 325          return value->builtin_int64 * other.value
 326      }
 327  
 328      ===Multiplies this number by another number.===
 329      @priority(10)
 330      function *(other:Int):Int {
 331          return value->builtin_int * other.value
 332      }
 333  
 334      ===Multiplies this number by another number.===
 335      @priority(1)
 336      function *(other:UInt8):Int32 {
 337          return value->builtin_int32 * other.value->builtin_int32
 338      }
 339  
 340      ===Multiplies this number by another number.===
 341      @priority(3)
 342      function *(other:UInt16):Int32 {
 343          return value->builtin_int32 * other.value->builtin_int32
 344      }
 345  
 346      ===Multiplies this number by another number.===
 347      @priority(5)
 348      function *(other:UInt32):Int64 {
 349          return value->builtin_int64 * other.value->builtin_int64
 350      }
 351  
 352      ===Multiplies this number by another number.===
 353      @priority(9)
 354      function *(other:UInt):Int64 {
 355          return value->builtin_int64 * other.value->builtin_int64
 356      }
 357  
 358      ===Multiplies this number by another number without checking for overflow.===
 359      @priority(20)
 360      function *&(other:Int8):Int32 {
 361          return value->builtin_int32 *& other.value->builtin_int32
 362      }
 363      ===Multiplies this number by another number without checking for overflow.===
 364      @priority(-1)
 365      function *&(other:Int8):Int8 {
 366          return value *& other.value
 367      }
 368  
 369      ===Multiplies this number by another number without checking for overflow.===
 370      @priority(4)
 371      function *&(other:Int16):Int32 {
 372          return value->builtin_int32 *& other.value->builtin_int32
 373      }
 374  
 375      ===Multiplies this number by another number without checking for overflow.===
 376      @priority(6)
 377      function *&(other:Int32):Int32 {
 378          return value->builtin_int32 *& other.value
 379      }
 380  
 381      ===Multiplies this number by another number without checking for overflow.===
 382      @priority(8)
 383      function *&(other:Int64):Int64 {
 384          return value->builtin_int64 *& other.value
 385      }
 386  
 387      ===Multiplies this number by another number without checking for overflow.===
 388      @priority(10)
 389      function *&(other:Int):Int {
 390          return value->builtin_int *& other.value
 391      }
 392  
 393      ===Multiplies this number by another number without checking for overflow.===
 394      @priority(1)
 395      function *&(other:UInt8):Int32 {
 396          return value->builtin_int32 *& other.value->builtin_int32
 397      }
 398  
 399      ===Multiplies this number by another number without checking for overflow.===
 400      @priority(3)
 401      function *&(other:UInt16):Int32 {
 402          return value->builtin_int32 *& other.value->builtin_int32
 403      }
 404  
 405      ===Multiplies this number by another number without checking for overflow.===
 406      @priority(5)
 407      function *&(other:UInt32):Int64 {
 408          return value->builtin_int64 *& other.value->builtin_int64
 409      }
 410  
 411      ===Multiplies this number by another number without checking for overflow.===
 412      @priority(9)
 413      function *&(other:UInt):Int64 {
 414          return value->builtin_int64 *& other.value->builtin_int64
 415      }
 416  
 417      ===Divides this number by another number, returning the whole number portion.===
 418      @priority(20)
 419      function //(other:Int8):Int32 {
 420          return value->builtin_int32 // other.value->builtin_int32
 421      }
 422      ===Divides this number by another number, returning the whole number portion.===
 423      @priority(-1)
 424      function //(other:Int8):Int8 {
 425          return value // other.value
 426      }
 427  
 428      ===Divides this number by another number, returning the whole number portion.===
 429      @priority(4)
 430      function //(other:Int16):Int32 {
 431          return value->builtin_int32 // other.value->builtin_int32
 432      }
 433  
 434      ===Divides this number by another number, returning the whole number portion.===
 435      @priority(6)
 436      function //(other:Int32):Int32 {
 437          return value->builtin_int32 // other.value
 438      }
 439  
 440      ===Divides this number by another number, returning the whole number portion.===
 441      @priority(8)
 442      function //(other:Int64):Int64 {
 443          return value->builtin_int64 // other.value
 444      }
 445  
 446      ===Divides this number by another number, returning the whole number portion.===
 447      @priority(10)
 448      function //(other:Int):Int {
 449          return value->builtin_int // other.value
 450      }
 451  
 452      ===Divides this number by another number, returning the whole number portion.===
 453      @priority(1)
 454      function //(other:UInt8):Int32 {
 455          return value->builtin_int32 // other.value->builtin_int32
 456      }
 457  
 458      ===Divides this number by another number, returning the whole number portion.===
 459      @priority(3)
 460      function //(other:UInt16):Int32 {
 461          return value->builtin_int32 // other.value->builtin_int32
 462      }
 463  
 464      ===Divides this number by another number, returning the whole number portion.===
 465      @priority(5)
 466      function //(other:UInt32):Int64 {
 467          return value->builtin_int64 // other.value->builtin_int64
 468      }
 469  
 470      ===Divides this number by another number, returning the whole number portion.===
 471      @priority(9)
 472      function //(other:UInt):Int64 {
 473          return value->builtin_int64 // other.value->builtin_int64
 474      }
 475  
 476      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 477      @priority(20)
 478      function //&(other:Int8):Int32 {
 479          return value->builtin_int32 //& other.value->builtin_int32
 480      }
 481      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 482      @priority(-1)
 483      function //&(other:Int8):Int8 {
 484          return value //& other.value
 485      }
 486  
 487      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 488      @priority(4)
 489      function //&(other:Int16):Int32 {
 490          return value->builtin_int32 //& other.value->builtin_int32
 491      }
 492  
 493      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 494      @priority(6)
 495      function //&(other:Int32):Int32 {
 496          return value->builtin_int32 //& other.value
 497      }
 498  
 499      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 500      @priority(8)
 501      function //&(other:Int64):Int64 {
 502          return value->builtin_int64 //& other.value
 503      }
 504  
 505      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 506      @priority(10)
 507      function //&(other:Int):Int {
 508          return value->builtin_int //& other.value
 509      }
 510  
 511      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 512      @priority(1)
 513      function //&(other:UInt8):Int32 {
 514          return value->builtin_int32 //& other.value->builtin_int32
 515      }
 516  
 517      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 518      @priority(3)
 519      function //&(other:UInt16):Int32 {
 520          return value->builtin_int32 //& other.value->builtin_int32
 521      }
 522  
 523      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 524      @priority(5)
 525      function //&(other:UInt32):Int64 {
 526          return value->builtin_int64 //& other.value->builtin_int64
 527      }
 528  
 529      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
 530      @priority(9)
 531      function //&(other:UInt):Int64 {
 532          return value->builtin_int64 //& other.value->builtin_int64
 533      }
 534  
 535      ===Returns the remainder of dividing this number by another number.===
 536      @priority(20)
 537      function %(other:Int8):Int32 {
 538          return value->builtin_int32 % other.value->builtin_int32
 539      }
 540      ===Returns the remainder of dividing this number by another number.===
 541      @priority(-1)
 542      function %(other:Int8):Int8 {
 543          return value % other.value
 544      }
 545  
 546      ===Returns the remainder of dividing this number by another number.===
 547      @priority(4)
 548      function %(other:Int16):Int32 {
 549          return value->builtin_int32 % other.value->builtin_int32
 550      }
 551  
 552      ===Returns the remainder of dividing this number by another number.===
 553      @priority(6)
 554      function %(other:Int32):Int32 {
 555          return value->builtin_int32 % other.value
 556      }
 557  
 558      ===Returns the remainder of dividing this number by another number.===
 559      @priority(8)
 560      function %(other:Int64):Int64 {
 561          return value->builtin_int64 % other.value
 562      }
 563  
 564      ===Returns the remainder of dividing this number by another number.===
 565      @priority(10)
 566      function %(other:Int):Int {
 567          return value->builtin_int % other.value
 568      }
 569  
 570      ===Returns the remainder of dividing this number by another number.===
 571      @priority(1)
 572      function %(other:UInt8):Int32 {
 573          return value->builtin_int32 % other.value->builtin_int32
 574      }
 575  
 576      ===Returns the remainder of dividing this number by another number.===
 577      @priority(3)
 578      function %(other:UInt16):Int32 {
 579          return value->builtin_int32 % other.value->builtin_int32
 580      }
 581  
 582      ===Returns the remainder of dividing this number by another number.===
 583      @priority(5)
 584      function %(other:UInt32):Int64 {
 585          return value->builtin_int64 % other.value->builtin_int64
 586      }
 587  
 588      ===Returns the remainder of dividing this number by another number.===
 589      @priority(9)
 590      function %(other:UInt):Int64 {
 591          return value->builtin_int64 % other.value->builtin_int64
 592      }
 593  
 594      ===Divides this number by another number.===
 595      @priority(20)
 596      function /(other:Int8):Real32 {
 597          return value->builtin_float32 / other.value->builtin_float32
 598      }
 599  
 600      ===Divides this number by another number.===
 601      @priority(4)
 602      function /(other:Int16):Real32 {
 603          return value->builtin_float32 / other.value->builtin_float32
 604      }
 605  
 606      ===Divides this number by another number.===
 607      @priority(6)
 608      function /(other:Int32):Real32 {
 609          return value->builtin_float32 / other.value->builtin_float32
 610      }
 611  
 612      ===Divides this number by another number.===
 613      @priority(8)
 614      function /(other:Int64):Real64 {
 615          return value->builtin_float64 / other.value->builtin_float64
 616      }
 617  
 618      ===Divides this number by another number.===
 619      @priority(1)
 620      function /(other:UInt8):Real32 {
 621          return value->builtin_float32 / other.value->builtin_float32
 622      }
 623  
 624      ===Divides this number by another number.===
 625      @priority(3)
 626      function /(other:UInt16):Real32 {
 627          return value->builtin_float32 / other.value->builtin_float32
 628      }
 629  
 630      ===Divides this number by another number.===
 631      @priority(5)
 632      function /(other:UInt32):Real32 {
 633          return value->builtin_float32 / other.value->builtin_float32
 634      }
 635  
 636      ===Divides this number by another number.===
 637      @priority(7)
 638      function /(other:UInt64):Real64 {
 639          return value->builtin_float64 / other.value->builtin_float64
 640      }
 641  
 642      ===Divides this number by another number.===
 643      @priority(11)
 644      function /(other:Real32):Real32 {
 645          return value->builtin_float32 / other.value
 646      }
 647  
 648      ===Divides this number by another number.===
 649      @priority(12)
 650      function /(other:Real64):Real64 {
 651          return value->builtin_float64 / other.value
 652      }
 653  
 654      ===Returns the bitwise NOT of this number.===
 655      function !!():Int8 {
 656          return Int8(!!value)
 657      }
 658  
 659      ===Returns the bitwise AND of this number with another number.===
 660      @priority(20)
 661      function &&(other:Int8):Int32 {
 662          return value->builtin_int32 && other.value->builtin_int32
 663      }
 664      ===Returns the bitwise AND of this number with another number.===
 665      @priority(-1)
 666      function &&(other:Int8):Int8 {
 667          return value && other.value
 668      }
 669  
 670      ===Returns the bitwise AND of this number with another number.===
 671      @priority(4)
 672      function &&(other:Int16):Int32 {
 673          return value->builtin_int32 && other.value->builtin_int32
 674      }
 675  
 676      ===Returns the bitwise AND of this number with another number.===
 677      @priority(6)
 678      function &&(other:Int32):Int32 {
 679          return value->builtin_int32 && other.value
 680      }
 681  
 682      ===Returns the bitwise AND of this number with another number.===
 683      @priority(8)
 684      function &&(other:Int64):Int64 {
 685          return value->builtin_int64 && other.value
 686      }
 687  
 688      ===Returns the bitwise AND of this number with another number.===
 689      @priority(10)
 690      function &&(other:Int):Int {
 691          return value->builtin_int && other.value
 692      }
 693  
 694      ===Returns the bitwise AND of this number with another number.===
 695      @priority(1)
 696      function &&(other:UInt8):UInt32 {
 697          return value->builtin_uint32 && other.value->builtin_uint32
 698      }
 699  
 700      ===Returns the bitwise AND of this number with another number.===
 701      @priority(3)
 702      function &&(other:UInt16):UInt32 {
 703          return value->builtin_uint32 && other.value->builtin_uint32
 704      }
 705  
 706      ===Returns the bitwise AND of this number with another number.===
 707      @priority(5)
 708      function &&(other:UInt32):UInt32 {
 709          return value->builtin_uint32 && other.value
 710      }
 711  
 712      ===Returns the bitwise AND of this number with another number.===
 713      @priority(7)
 714      function &&(other:UInt64):UInt64 {
 715          return value->builtin_uint64 && other.value
 716      }
 717  
 718      ===Returns the bitwise AND of this number with another number.===
 719      @priority(9)
 720      function &&(other:UInt):UInt {
 721          return value->builtin_uint && other.value
 722      }
 723  
 724      ===Returns the bitwise OR of this number with another number.===
 725      @priority(20)
 726      function ||(other:Int8):Int32 {
 727          return value->builtin_int32 || other.value->builtin_int32
 728      }
 729      ===Returns the bitwise OR of this number with another number.===
 730      @priority(-1)
 731      function ||(other:Int8):Int8 {
 732          return value || other.value
 733      }
 734  
 735      ===Returns the bitwise OR of this number with another number.===
 736      @priority(4)
 737      function ||(other:Int16):Int32 {
 738          return value->builtin_int32 || other.value->builtin_int32
 739      }
 740  
 741      ===Returns the bitwise OR of this number with another number.===
 742      @priority(6)
 743      function ||(other:Int32):Int32 {
 744          return value->builtin_int32 || other.value
 745      }
 746  
 747      ===Returns the bitwise OR of this number with another number.===
 748      @priority(8)
 749      function ||(other:Int64):Int64 {
 750          return value->builtin_int64 || other.value
 751      }
 752  
 753      ===Returns the bitwise OR of this number with another number.===
 754      @priority(10)
 755      function ||(other:Int):Int {
 756          return value->builtin_int || other.value
 757      }
 758  
 759      ===Returns the bitwise OR of this number with another number.===
 760      @priority(1)
 761      function ||(other:UInt8):UInt32 {
 762          return value->builtin_uint32 || other.value->builtin_uint32
 763      }
 764  
 765      ===Returns the bitwise OR of this number with another number.===
 766      @priority(3)
 767      function ||(other:UInt16):UInt32 {
 768          return value->builtin_uint32 || other.value->builtin_uint32
 769      }
 770  
 771      ===Returns the bitwise OR of this number with another number.===
 772      @priority(5)
 773      function ||(other:UInt32):UInt32 {
 774          return value->builtin_uint32 || other.value
 775      }
 776  
 777      ===Returns the bitwise OR of this number with another number.===
 778      @priority(7)
 779      function ||(other:UInt64):UInt64 {
 780          return value->builtin_uint64 || other.value
 781      }
 782  
 783      ===Returns the bitwise OR of this number with another number.===
 784      @priority(9)
 785      function ||(other:UInt):UInt {
 786          return value->builtin_uint || other.value
 787      }
 788  
 789      ===Returns the bitwise XOR of this number with another number.===
 790      @priority(20)
 791      function ~~(other:Int8):Int32 {
 792          return value->builtin_int32 ~~ other.value->builtin_int32
 793      }
 794      ===Returns the bitwise XOR of this number with another number.===
 795      @priority(-1)
 796      function ~~(other:Int8):Int8 {
 797          return value ~~ other.value
 798      }
 799  
 800      ===Returns the bitwise XOR of this number with another number.===
 801      @priority(4)
 802      function ~~(other:Int16):Int32 {
 803          return value->builtin_int32 ~~ other.value->builtin_int32
 804      }
 805  
 806      ===Returns the bitwise XOR of this number with another number.===
 807      @priority(6)
 808      function ~~(other:Int32):Int32 {
 809          return value->builtin_int32 ~~ other.value
 810      }
 811  
 812      ===Returns the bitwise XOR of this number with another number.===
 813      @priority(8)
 814      function ~~(other:Int64):Int64 {
 815          return value->builtin_int64 ~~ other.value
 816      }
 817  
 818      ===Returns the bitwise XOR of this number with another number.===
 819      @priority(10)
 820      function ~~(other:Int):Int {
 821          return value->builtin_int ~~ other.value
 822      }
 823  
 824      ===Returns the bitwise XOR of this number with another number.===
 825      @priority(1)
 826      function ~~(other:UInt8):UInt32 {
 827          return value->builtin_uint32 ~~ other.value->builtin_uint32
 828      }
 829  
 830      ===Returns the bitwise XOR of this number with another number.===
 831      @priority(3)
 832      function ~~(other:UInt16):UInt32 {
 833          return value->builtin_uint32 ~~ other.value->builtin_uint32
 834      }
 835  
 836      ===Returns the bitwise XOR of this number with another number.===
 837      @priority(5)
 838      function ~~(other:UInt32):UInt32 {
 839          return value->builtin_uint32 ~~ other.value
 840      }
 841  
 842      ===Returns the bitwise XOR of this number with another number.===
 843      @priority(7)
 844      function ~~(other:UInt64):UInt64 {
 845          return value->builtin_uint64 ~~ other.value
 846      }
 847  
 848      ===Returns the bitwise XOR of this number with another number.===
 849      @priority(9)
 850      function ~~(other:UInt):UInt {
 851          return value->builtin_uint ~~ other.value
 852      }
 853  
 854      ===Returns this number shifted left by the specified number of bits.===
 855      @priority(20)
 856      function <<(other:Int8):Int32 {
 857          return value->builtin_int32 << other.value->builtin_int32
 858      }
 859      ===Returns this number shifted left by the specified number of bits.===
 860      @priority(-1)
 861      function <<(other:Int8):Int8 {
 862          return value << other.value
 863      }
 864  
 865      ===Returns this number shifted left by the specified number of bits, without checking for overflow.===
 866      @priority(20)
 867      function <<&(other:Int8):Int32 {
 868          return value->builtin_int32 <<& other.value->builtin_int32
 869      }
 870      ===Returns this number shifted left by the specified number of bits, without checking for overflow.===
 871      @priority(-1)
 872      function <<&(other:Int8):Int8 {
 873          return value <<& other.value
 874      }
 875  
 876      ===Returns this number arithmetic shifted right by the specified number of bits.===
 877      @priority(20)
 878      function >>(other:Int8):Int32 {
 879          return value->builtin_int32 >> other.value->builtin_int32
 880      }
 881      ===Returns this number arithmetic shifted right by the specified number of bits.===
 882      @priority(-1)
 883      function >>(other:Int8):Int8 {
 884          return value >> other.value
 885      }
 886  
 887      ===Returns `true` if this number is equal to the given number.===
 888      @override
 889      @priority(20)
 890      function =(other:Int8):Bit {
 891          return value = other.value
 892      }
 893  
 894      ===Returns `true` if this number is equal to the given number.===
 895      @priority(4)
 896      function =(other:Int16):Bit {
 897          return value->builtin_int16 = other.value
 898      }
 899  
 900      ===Returns `true` if this number is equal to the given number.===
 901      @priority(6)
 902      function =(other:Int32):Bit {
 903          return value->builtin_int32 = other.value
 904      }
 905  
 906      ===Returns `true` if this number is equal to the given number.===
 907      @priority(8)
 908      function =(other:Int64):Bit {
 909          return value->builtin_int64 = other.value
 910      }
 911  
 912      ===Returns `true` if this number is equal to the given number.===
 913      @priority(10)
 914      function =(other:Int):Bit {
 915          return value->builtin_int = other.value
 916      }
 917  
 918      ===Returns `true` if this number is equal to the given number.===
 919      @priority(1)
 920      function =(other:UInt8):Bit {
 921          return value->builtin_int16 = other.value->builtin_int16
 922      }
 923  
 924      ===Returns `true` if this number is equal to the given number.===
 925      @priority(3)
 926      function =(other:UInt16):Bit {
 927          return value->builtin_int32 = other.value->builtin_int32
 928      }
 929  
 930      ===Returns `true` if this number is equal to the given number.===
 931      @priority(5)
 932      function =(other:UInt32):Bit {
 933          return value->builtin_int64 = other.value->builtin_int64
 934      }
 935  
 936      ===Returns `true` if this number is equal to the given number.===
 937      @priority(9)
 938      function =(other:UInt):Bit {
 939          return value->builtin_int64 = other.value->builtin_int64
 940      }
 941  
 942      ===Returns `true` if this number is not equal to the given number.===
 943      @override
 944      @priority(20)
 945      function !=(other:Int8):Bit {
 946          return value != other.value
 947      }
 948  
 949      ===Returns `true` if this number is not equal to the given number.===
 950      @priority(4)
 951      function !=(other:Int16):Bit {
 952          return value->builtin_int16 != other.value
 953      }
 954  
 955      ===Returns `true` if this number is not equal to the given number.===
 956      @priority(6)
 957      function !=(other:Int32):Bit {
 958          return value->builtin_int32 != other.value
 959      }
 960  
 961      ===Returns `true` if this number is not equal to the given number.===
 962      @priority(8)
 963      function !=(other:Int64):Bit {
 964          return value->builtin_int64 != other.value
 965      }
 966  
 967      ===Returns `true` if this number is not equal to the given number.===
 968      @priority(10)
 969      function !=(other:Int):Bit {
 970          return value->builtin_int != other.value
 971      }
 972  
 973      ===Returns `true` if this number is not equal to the given number.===
 974      @priority(1)
 975      function !=(other:UInt8):Bit {
 976          return value->builtin_int16 != other.value->builtin_int16
 977      }
 978  
 979      ===Returns `true` if this number is not equal to the given number.===
 980      @priority(3)
 981      function !=(other:UInt16):Bit {
 982          return value->builtin_int32 != other.value->builtin_int32
 983      }
 984  
 985      ===Returns `true` if this number is not equal to the given number.===
 986      @priority(5)
 987      function !=(other:UInt32):Bit {
 988          return value->builtin_int64 != other.value->builtin_int64
 989      }
 990  
 991      ===Returns `true` if this number is not equal to the given number.===
 992      @priority(9)
 993      function !=(other:UInt):Bit {
 994          return value->builtin_int64 != other.value->builtin_int64
 995      }
 996  
 997      ===Returns `true` if this number is less than the given number.===
 998      @override
 999      @priority(20)
1000      function <(other:Int8):Bit {
1001          return value < other.value
1002      }< other.value
1003      }
1004  
1005      ===Returns `true` if this number is less than the given number.===
1006      @priority(4)
1007      function <(other:Int16):Bit {
1008          return value->builtin_int16 < other.value
1009      }< other.value
1010      }
1011  
1012      ===Returns `true` if this number is less than the given number.===
1013      @priority(6)
1014      function <(other:Int32):Bit {
1015          return value->builtin_int32 < other.value
1016      }< other.value
1017      }
1018  
1019      ===Returns `true` if this number is less than the given number.===
1020      @priority(8)
1021      function <(other:Int64):Bit {
1022          return value->builtin_int64 < other.value
1023      }< other.value
1024      }
1025  
1026      ===Returns `true` if this number is less than the given number.===
1027      @priority(10)
1028      function <(other:Int):Bit {
1029          return value->builtin_int < other.value
1030      }< other.value
1031      }
1032  
1033      ===Returns `true` if this number is less than the given number.===
1034      @priority(1)
1035      function <(other:UInt8):Bit {
1036          return value->builtin_int16 < other.value->< other.value->builtin_int16
1037      }
1038  
1039      ===Returns `true` if this number is less than the given number.===
1040      @priority(3)
1041      function <(other:UInt16):Bit {
1042          return value->builtin_int32 < other.value->< other.value->builtin_int32
1043      }
1044  
1045      ===Returns `true` if this number is less than the given number.===
1046      @priority(5)
1047      function <(other:UInt32):Bit {
1048          return value->builtin_int64 < other.value->< other.value->builtin_int64
1049      }
1050  
1051      ===Returns `true` if this number is less than the given number.===
1052      @priority(9)
1053      function <(other:UInt):Bit {
1054          return value->builtin_int64 < other.value->< other.value->builtin_int64
1055      }
1056  
1057      ===Returns `true` if this number is greater than the given number.===
1058      @override
1059      @priority(20)
1060      function >(other:Int8):Bit {
1061          return value > other.value
1062      }
1063  
1064      ===Returns `true` if this number is greater than the given number.===
1065      @priority(4)
1066      function >(other:Int16):Bit {
1067          return value->builtin_int16 > other.value
1068      }
1069  
1070      ===Returns `true` if this number is greater than the given number.===
1071      @priority(6)
1072      function >(other:Int32):Bit {
1073          return value->builtin_int32 > other.value
1074      }
1075  
1076      ===Returns `true` if this number is greater than the given number.===
1077      @priority(8)
1078      function >(other:Int64):Bit {
1079          return value->builtin_int64 > other.value
1080      }
1081  
1082      ===Returns `true` if this number is greater than the given number.===
1083      @priority(10)
1084      function >(other:Int):Bit {
1085          return value->builtin_int > other.value
1086      }
1087  
1088      ===Returns `true` if this number is greater than the given number.===
1089      @priority(1)
1090      function >(other:UInt8):Bit {
1091          return value->builtin_int16 > other.value->builtin_int16
1092      }
1093  
1094      ===Returns `true` if this number is greater than the given number.===
1095      @priority(3)
1096      function >(other:UInt16):Bit {
1097          return value->builtin_int32 > other.value->builtin_int32
1098      }
1099  
1100      ===Returns `true` if this number is greater than the given number.===
1101      @priority(5)
1102      function >(other:UInt32):Bit {
1103          return value->builtin_int64 > other.value->builtin_int64
1104      }
1105  
1106      ===Returns `true` if this number is greater than the given number.===
1107      @priority(9)
1108      function >(other:UInt):Bit {
1109          return value->builtin_int64 > other.value->builtin_int64
1110      }
1111  
1112      ===Returns `true` if this number is greater than or equal to the given number.===
1113      @override
1114      @priority(20)
1115      function >=(other:Int8):Bit {
1116          return value >= other.value
1117      }
1118  
1119      ===Returns `true` if this number is greater than or equal to the given number.===
1120      @priority(4)
1121      function >=(other:Int16):Bit {
1122          return value->builtin_int16 >= other.value
1123      }
1124  
1125      ===Returns `true` if this number is greater than or equal to the given number.===
1126      @priority(6)
1127      function >=(other:Int32):Bit {
1128          return value->builtin_int32 >= other.value
1129      }
1130  
1131      ===Returns `true` if this number is greater than or equal to the given number.===
1132      @priority(8)
1133      function >=(other:Int64):Bit {
1134          return value->builtin_int64 >= other.value
1135      }
1136  
1137      ===Returns `true` if this number is greater than or equal to the given number.===
1138      @priority(10)
1139      function >=(other:Int):Bit {
1140          return value->builtin_int >= other.value
1141      }
1142  
1143      ===Returns `true` if this number is greater than or equal to the given number.===
1144      @priority(1)
1145      function >=(other:UInt8):Bit {
1146          return value->builtin_int16 >= other.value->builtin_int16
1147      }
1148  
1149      ===Returns `true` if this number is greater than or equal to the given number.===
1150      @priority(3)
1151      function >=(other:UInt16):Bit {
1152          return value->builtin_int32 >= other.value->builtin_int32
1153      }
1154  
1155      ===Returns `true` if this number is greater than or equal to the given number.===
1156      @priority(5)
1157      function >=(other:UInt32):Bit {
1158          return value->builtin_int64 >= other.value->builtin_int64
1159      }
1160  
1161      ===Returns `true` if this number is greater than or equal to the given number.===
1162      @priority(9)
1163      function >=(other:UInt):Bit {
1164          return value->builtin_int64 >= other.value->builtin_int64
1165      }
1166  
1167      ===Returns `true` if this number is less than or equal to the given number.===
1168      @override
1169      @priority(20)
1170      function <=(other:Int8):Bit {
1171          return value <= other.value
1172      }
1173  
1174      ===Returns `true` if this number is less than or equal to the given number.===
1175      @priority(4)
1176      function <=(other:Int16):Bit {
1177          return value->builtin_int16 <= other.value
1178      }
1179  
1180      ===Returns `true` if this number is less than or equal to the given number.===
1181      @priority(6)
1182      function <=(other:Int32):Bit {
1183          return value->builtin_int32 <= other.value
1184      }
1185  
1186      ===Returns `true` if this number is less than or equal to the given number.===
1187      @priority(8)
1188      function <=(other:Int64):Bit {
1189          return value->builtin_int64 <= other.value
1190      }
1191  
1192      ===Returns `true` if this number is less than or equal to the given number.===
1193      @priority(10)
1194      function <=(other:Int):Bit {
1195          return value->builtin_int <= other.value
1196      }
1197  
1198      ===Returns `true` if this number is less than or equal to the given number.===
1199      @priority(1)
1200      function <=(other:UInt8):Bit {
1201          return value->builtin_int16 <= other.value->builtin_int16
1202      }
1203  
1204      ===Returns `true` if this number is less than or equal to the given number.===
1205      @priority(3)
1206      function <=(other:UInt16):Bit {
1207          return value->builtin_int32 <= other.value->builtin_int32
1208      }
1209  
1210      ===Returns `true` if this number is less than or equal to the given number.===
1211      @priority(5)
1212      function <=(other:UInt32):Bit {
1213          return value->builtin_int64 <= other.value->builtin_int64
1214      }
1215  
1216      ===Returns `true` if this number is less than or equal to the given number.===
1217      @priority(9)
1218      function <=(other:UInt):Bit {
1219          return value->builtin_int64 <= other.value->builtin_int64
1220      }
1221      ===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.===
1222      @class
1223      function [](range:Range<Int8>):ListView<Int8> {
1224          return org.frostlang.frost.Int8List(SteppedRange<Int8, Int8>(range.min, range.max, 1, range.inclusive))
1225      }
1226      ===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.===
1227      @class
1228      function [](range:SteppedRange<Int8, Int8>):ListView<Int8> {
1229          return org.frostlang.frost.Int8List(range)
1230      }
1231  
1232      ===The absolute value of this number.===
1233      property abs:Int8
1234      function get_abs():Int8 {
1235          if self < 0 {
1236              return -self
1237          }
1238          return self
1239      }
1240      ===
1241      A view of this number as a collection of bits, with `bits[0]` as the least significant bit.
1242      ===
1243      property bits:ListView<Bit>
1244      function get_bits():ListView<Bit> { return Bits(self) }
1245  
1246      ===The square root of this number.===
1247      property sqrt:Real32
1248      function get_sqrt():Real32 {
1249          return toReal32.sqrt
1250      }
1251  
1252      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1253      @priority(20)
1254      function min(other:Int8):Int8 {
1255          if value < other.value {< other.value {
1256              return value
1257          }
1258          return other.value
1259      }
1260  
1261      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1262      @priority(4)
1263      function min(other:Int16):Int16 {
1264          if value->builtin_int16 < other.value {< other.value {
1265              return value->builtin_int16
1266          }
1267          return other.value
1268      }
1269  
1270      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1271      @priority(6)
1272      function min(other:Int32):Int32 {
1273          if value->builtin_int32 < other.value {< other.value {
1274              return value->builtin_int32
1275          }
1276          return other.value
1277      }
1278  
1279      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1280      @priority(8)
1281      function min(other:Int64):Int64 {
1282          if value->builtin_int64 < other.value {< other.value {
1283              return value->builtin_int64
1284          }
1285          return other.value
1286      }
1287  
1288      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1289      @priority(10)
1290      function min(other:Int):Int {
1291          if value->builtin_int < other.value {< other.value {
1292              return value->builtin_int
1293          }
1294          return other.value
1295      }
1296  
1297      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1298      @priority(1)
1299      function min(other:UInt8):Int16 {
1300          if value->builtin_int16 < other.value->< other.value->builtin_int16 {
1301              return value->builtin_int16
1302          }
1303          return other.value->builtin_int16
1304      }
1305  
1306      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1307      @priority(3)
1308      function min(other:UInt16):Int32 {
1309          if value->builtin_int32 < other.value->< other.value->builtin_int32 {
1310              return value->builtin_int32
1311          }
1312          return other.value->builtin_int32
1313      }
1314  
1315      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1316      @priority(5)
1317      function min(other:UInt32):Int64 {
1318          if value->builtin_int64 < other.value->< other.value->builtin_int64 {
1319              return value->builtin_int64
1320          }
1321          return other.value->builtin_int64
1322      }
1323  
1324  
1325      ===Returns the smaller (closest to negative infinity) of this number and another number.===
1326      @priority(9)
1327      function min(other:UInt):Int64 {
1328          if value->builtin_int64 < other.value->< other.value->builtin_int64 {
1329              return value->builtin_int64
1330          }
1331          return other.value->builtin_int64
1332      }
1333  
1334      ===Returns the larger (closest to positive infinity) of this number and another number.===
1335      @priority(20)
1336      function max(other:Int8):Int8 {
1337          if value > other.value {
1338              return value
1339          }
1340          return other.value
1341      }
1342  
1343      ===Returns the larger (closest to positive infinity) of this number and another number.===
1344      @priority(4)
1345      function max(other:Int16):Int16 {
1346          if value->builtin_int16 > other.value {
1347              return value->builtin_int16
1348          }
1349          return other.value
1350      }
1351  
1352      ===Returns the larger (closest to positive infinity) of this number and another number.===
1353      @priority(6)
1354      function max(other:Int32):Int32 {
1355          if value->builtin_int32 > other.value {
1356              return value->builtin_int32
1357          }
1358          return other.value
1359      }
1360  
1361      ===Returns the larger (closest to positive infinity) of this number and another number.===
1362      @priority(8)
1363      function max(other:Int64):Int64 {
1364          if value->builtin_int64 > other.value {
1365              return value->builtin_int64
1366          }
1367          return other.value
1368      }
1369  
1370      ===Returns the larger (closest to positive infinity) of this number and another number.===
1371      @priority(10)
1372      function max(other:Int):Int {
1373          if value->builtin_int > other.value {
1374              return value->builtin_int
1375          }
1376          return other.value
1377      }
1378  
1379      ===Returns the larger (closest to positive infinity) of this number and another number.===
1380      @priority(1)
1381      function max(other:UInt8):Int16 {
1382          if value->builtin_int16 > other.value->builtin_int16 {
1383              return value->builtin_int16
1384          }
1385          return other.value->builtin_int16
1386      }
1387  
1388      ===Returns the larger (closest to positive infinity) of this number and another number.===
1389      @priority(3)
1390      function max(other:UInt16):Int32 {
1391          if value->builtin_int32 > other.value->builtin_int32 {
1392              return value->builtin_int32
1393          }
1394          return other.value->builtin_int32
1395      }
1396  
1397      ===Returns the larger (closest to positive infinity) of this number and another number.===
1398      @priority(5)
1399      function max(other:UInt32):Int64 {
1400          if value->builtin_int64 > other.value->builtin_int64 {
1401              return value->builtin_int64
1402          }
1403          return other.value->builtin_int64
1404      }
1405  
1406  
1407      ===Returns the larger (closest to positive infinity) of this number and another number.===
1408      @priority(9)
1409      function max(other:UInt):Int64 {
1410          if value->builtin_int64 > other.value->builtin_int64 {
1411              return value->builtin_int64
1412          }
1413          return other.value->builtin_int64
1414      }
1415  
1416      @override
1417      function get_hash():Int {
1418          return Int(value->builtin_int)
1419      }
1420  
1421      ===The number of `1` bits in this number's binary representation.===
1422      property bitCount:Int8
1423      @external(frostInt8_get_bitCount)
1424      function get_bitCount():Int8
1425  
1426      ===Parses a string as a number in the specified radix. Returns `null` if the parse fails.===
1427      @class
1428      @pre(radix >= 2 & radix <= 36)
1429      function parse(str:String, radix:Int):Int8? {
1430          if str.startsWith("-") {
1431              def abs := Frost.parse(str[1..], radix)
1432              if abs == null {
1433                  return null
1434              }
1435              return -(abs.asInt8)
1436          }
1437          else {
1438              def result := Frost.parse(str, radix)
1439              if result == null {
1440                  return null
1441              }
1442              return result.asInt8
1443          }
1444      }
1445  
1446      ===
1447      This number converted to an Int.
1448      ===
1449      property asInt:Int
1450      function get_asInt():Int {
1451          return Int(value->builtin_int)
1452      }
1453  
1454      ===
1455      This number converted to an Int.
1456      ===
1457      property toInt:Int
1458      function get_toInt():Int {
1459          return Int(value->builtin_int)
1460      }
1461  
1462      ===
1463      This number sign extended to a 16 bit signed number.
1464      ===
1465      property asInt16:Int16
1466      function get_asInt16():Int16 {
1467          return Int16(value->builtin_int16)
1468      }
1469  
1470      ===
1471      This number sign extended to a 16 bit signed number.
1472      ===
1473      property toInt16:Int16
1474      function get_toInt16():Int16 {
1475          return Int16(value->builtin_int16)
1476      }
1477  
1478      ===
1479      This number sign extended to a 32 bit signed number.
1480      ===
1481      property asInt32:Int32
1482      function get_asInt32():Int32 {
1483          return Int32(value->builtin_int32)
1484      }
1485  
1486      ===
1487      This number sign extended to a 32 bit signed number.
1488      ===
1489      property toInt32:Int32
1490      function get_toInt32():Int32 {
1491          return Int32(value->builtin_int32)
1492      }
1493  
1494      ===
1495      This number sign extended to a 64 bit signed number.
1496      ===
1497      property asInt64:Int64
1498      function get_asInt64():Int64 {
1499          return Int64(value->builtin_int64)
1500      }
1501  
1502      ===
1503      This number sign extended to a 64 bit signed number.
1504      ===
1505      property toInt64:Int64
1506      function get_toInt64():Int64 {
1507          return Int64(value->builtin_int64)
1508      }
1509  
1510      ===
1511      This number converted to a UInt.
1512      If this number is not in the range of a UInt, a safety violation occurs.
1513      ===
1514      property asUInt:UInt
1515      function get_asUInt():UInt {
1516      assert self >= UInt.MIN.toInt8, "Int8(\{self}) cannot be safely converted to UInt"
1517          return UInt(value->builtin_uint)
1518      }
1519  
1520      ===
1521      This number converted to a UInt.
1522      This function never fails, even if the number is not in the range of a UInt.
1523      ===
1524      property toUInt:UInt
1525      function get_toUInt():UInt {
1526          return UInt(value->builtin_uint)
1527      }
1528  
1529      ===
1530      This number reinterpreted as an 8 bit unsigned number.
1531      If this number is not in the range of an 8 bit unsigned number, a safety violation occurs.
1532      ===
1533      property asUInt8:UInt8
1534      function get_asUInt8():UInt8 {
1535      assert self >= UInt8.MIN.toInt8, "Int8(\{self}) cannot be safely converted to UInt8"
1536          return UInt8(value->builtin_uint8)
1537      }
1538  
1539      ===
1540      This number reinterpreted as an 8 bit unsigned number.
1541      This function never fails, even if the number is not in the range of an 8 bit unsigned number.
1542      ===
1543      property toUInt8:UInt8
1544      function get_toUInt8():UInt8 {
1545          return UInt8(value->builtin_uint8)
1546      }
1547  
1548      ===
1549      This number sign extended to a 16 bit unsigned number.
1550      If this number is not in the range of a 16 bit unsigned number, a safety violation occurs.
1551      ===
1552      property asUInt16:UInt16
1553      function get_asUInt16():UInt16 {
1554      assert self >= UInt16.MIN.toInt8, "Int8(\{self}) cannot be safely converted to UInt16"
1555          return UInt16(value->builtin_uint16)
1556      }
1557  
1558      ===
1559      This number sign extended to a 16 bit unsigned number.
1560      This function never fails, even if the number is not in the range of a 16 bit unsigned number.
1561      ===
1562      property toUInt16:UInt16
1563      function get_toUInt16():UInt16 {
1564          return UInt16(value->builtin_uint16)
1565      }
1566  
1567      ===
1568      This number sign extended to a 32 bit unsigned number.
1569      If this number is not in the range of a 32 bit unsigned number, a safety violation occurs.
1570      ===
1571      property asUInt32:UInt32
1572      function get_asUInt32():UInt32 {
1573      assert self >= UInt32.MIN.toInt8, "Int8(\{self}) cannot be safely converted to UInt32"
1574          return UInt32(value->builtin_uint32)
1575      }
1576  
1577      ===
1578      This number sign extended to a 32 bit unsigned number.
1579      This function never fails, even if the number is not in the range of a 32 bit unsigned number.
1580      ===
1581      property toUInt32:UInt32
1582      function get_toUInt32():UInt32 {
1583          return UInt32(value->builtin_uint32)
1584      }
1585  
1586      ===
1587      This number sign extended to a 64 bit unsigned number.
1588      If this number is not in the range of a 64 bit unsigned number, a safety violation occurs.
1589      ===
1590      property asUInt64:UInt64
1591      function get_asUInt64():UInt64 {
1592      assert self >= UInt64.MIN.toInt8, "Int8(\{self}) cannot be safely converted to UInt64"
1593          return UInt64(value->builtin_uint64)
1594      }
1595  
1596      ===
1597      This number sign extended to a 64 bit unsigned number.
1598      This function never fails, even if the number is not in the range of a 64 bit unsigned number.
1599      ===
1600      property toUInt64:UInt64
1601      function get_toUInt64():UInt64 {
1602          return UInt64(value->builtin_uint64)
1603      }
1604  
1605      ===
1606      This number converted to a 32 bit floating point number.
1607      ===
1608      property asReal32:Real32
1609      function get_asReal32():Real32 {
1610          return Real32(value->builtin_float32)
1611      }
1612  
1613      ===
1614      This number converted to a 32 bit floating point number.
1615      ===
1616      property toReal32:Real32
1617      function get_toReal32():Real32 {
1618          return Real32(value->builtin_float32)
1619      }
1620  
1621      ===
1622      This number converted to a 64 bit floating point number.
1623      ===
1624      property asReal64:Real64
1625      function get_asReal64():Real64 {
1626          return Real64(value->builtin_float64)
1627      }
1628  
1629      ===
1630      This number converted to a 64 bit floating point number.
1631      ===
1632      property toReal64:Real64
1633      function get_toReal64():Real64 {
1634          return Real64(value->builtin_float64)
1635      }
1636  
1637      ===Returns this number converted to a decimal string.===
1638      @override
1639      function get_toString():String {
1640          constant max := 4
1641          def chars := Pointer<Char8>.alloc(max)
1642          var index := max - 1
1643          var value := self
1644          if value >= 0 {
1645              do {
1646                  chars[index] := Char8((value % 10 + 48).asUInt8)
1647                  value := (value // 10).asInt8
1648                  index -= 1
1649              }
1650              while value > 0
1651              index += 1
1652          }
1653          else {
1654              do {
1655                  chars[index] := Char8((48 - value % 10).asUInt8)
1656                  value := (value // 10).asInt8
1657                  index -= 1
1658              }
1659              while value < 0< 0
1660              chars[index] := "-"
1661          }
1662          def size := max - index
1663          for i in 0 .. size {
1664              chars[i] := chars[i + index]
1665          }
1666          return String(chars, size)
1667      }
1668  
1669      === 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. ===
1670      @override
1671      function format(fmt:String):String {
1672          return Frost.format(value < 0< 0, abs.toUInt64, 0xFF, fmt)
1673      }
1674  }
1675