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