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 64-bit signed integer.
 11  ===
 12  class Int64 : Value, HashKey<Int64>, Comparable<Int64>, Formattable {
 13      @private
 14      class Bits : ListView<Bit> {
 15          def value:Int64
 16          init(value:Int64) {
 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 64.
 28          ===
 29          @override
 30          function get_count():Int {
 31              return 64
 32          }
 33  
 34          @override
 35          function get_iterator():Iterator<Bit> {
 36              return org.frostlang.frost.IntBitIterator(value.toUInt64, 1 << (64->builtin_uint64 - 1))
 37          }
 38      }
 39      ===
 40      The smallest value this type can hold (-9,223,372,036,854,775,808).
 41      ===
 42      constant MIN:Int64 := -9223372036854775808
 43  
 44      ===
 45      The largest value this type can hold (9,223,372,036,854,775,807).
 46      ===
 47      constant MAX:Int64 := 9223372036854775807
 48  
 49      @package
 50      def value:builtin_int64
 51  
 52      ===@hidden===
 53      @implicit
 54      init(value:builtin_int64) {
 55          self.value := value
 56      }
 57  
 58      ===@hidden===
 59      @implicit
 60      @priority(-6)
 61      init(value:Int8) {
 62          self.value := value.value->builtin_int64
 63      }
 64  
 65      ===@hidden===
 66      @implicit
 67      @priority(-5)
 68      init(value:Int16) {
 69          self.value := value.value->builtin_int64
 70      }
 71  
 72      ===@hidden===
 73      @implicit
 74      @priority(-4)
 75      init(value:Int32) {
 76          self.value := value.value->builtin_int64
 77      }
 78  
 79      ===@hidden===
 80      @implicit
 81      @priority(-3)
 82      init(value:UInt8) {
 83          self.value := value.value->builtin_int64
 84      }
 85  
 86      ===@hidden===
 87      @implicit
 88      @priority(-2)
 89      init(value:UInt16) {
 90          self.value := value.value->builtin_int64
 91      }
 92  
 93      ===@hidden===
 94      @implicit
 95      @priority(-1)
 96      init(value:UInt32) {
 97          self.value := value.value->builtin_int64
 98      }
 99  
100      ===@hidden===
101      @implicit
102      @priority(-4)
103      init(value:Int) {
104          self.value := value.value->builtin_int64
105      }
106  
107      ===Adds another number to this number.===
108      @priority(20)
109      function +(other:Int64):Int64 {
110          return value + other.value
111      }
112  
113      ===Adds another number to this number without checking for overflow.===
114      @priority(20)
115      function +&(other:Int64):Int64 {
116          return value +& other.value
117      }
118  
119      ===Subtracts another number from this number.===
120      @priority(20)
121      function -(other:Int64):Int64 {
122          return value - other.value
123      }
124  
125      ===Subtracts another number from this number without checking for overflow.===
126      @priority(20)
127      function -&(other:Int64):Int64 {
128          return value -& other.value
129      }
130  
131      ===Returns the negation (additive inverse) of this number===
132      function -():Int64 {
133          return Int64(-value)
134      }
135  
136      ===Multiplies this number by another number.===
137      @priority(20)
138      function *(other:Int64):Int64 {
139          return value * other.value
140      }
141  
142      ===Multiplies this number by another number without checking for overflow.===
143      @priority(20)
144      function *&(other:Int64):Int64 {
145          return value *& other.value
146      }
147  
148      ===Divides this number by another number, returning the whole number portion.===
149      @priority(20)
150      function //(other:Int64):Int64 {
151          return value // other.value
152      }
153  
154      ===Divides this number by another number, returning the whole number portion, without checking for overflow.===
155      @priority(20)
156      function //&(other:Int64):Int64 {
157          return value //& other.value
158      }
159  
160      ===Returns the remainder of dividing this number by another number.===
161      @priority(20)
162      function %(other:Int64):Int64 {
163          return value % other.value
164      }
165  
166      ===Divides this number by another number.===
167      @priority(8)
168      function /(other:Int8):Real64 {
169          return value->builtin_float64 / other.value->builtin_float64
170      }
171  
172      ===Divides this number by another number.===
173      @priority(10)
174      function /(other:Int16):Real64 {
175          return value->builtin_float64 / other.value->builtin_float64
176      }
177  
178      ===Divides this number by another number.===
179      @priority(12)
180      function /(other:Int32):Real64 {
181          return value->builtin_float64 / other.value->builtin_float64
182      }
183  
184      ===Divides this number by another number.===
185      @priority(20)
186      function /(other:Int64):Real64 {
187          return value->builtin_float64 / other.value->builtin_float64
188      }
189  
190      ===Divides this number by another number.===
191      @priority(7)
192      function /(other:UInt8):Real64 {
193          return value->builtin_float64 / other.value->builtin_float64
194      }
195  
196      ===Divides this number by another number.===
197      @priority(9)
198      function /(other:UInt16):Real64 {
199          return value->builtin_float64 / other.value->builtin_float64
200      }
201  
202      ===Divides this number by another number.===
203      @priority(11)
204      function /(other:UInt32):Real64 {
205          return value->builtin_float64 / other.value->builtin_float64
206      }
207  
208      ===Divides this number by another number.===
209      @priority(13)
210      function /(other:UInt64):Real64 {
211          return value->builtin_float64 / other.value->builtin_float64
212      }
213  
214      ===Divides this number by another number.===
215      @priority(17)
216      function /(other:Real32):Real64 {
217          return value->builtin_float64 / other.value->builtin_float64
218      }
219  
220      ===Divides this number by another number.===
221      @priority(18)
222      function /(other:Real64):Real64 {
223          return value->builtin_float64 / other.value
224      }
225  
226      ===Returns the bitwise NOT of this number.===
227      function !!():Int64 {
228          return Int64(!!value)
229      }
230  
231      ===Returns the bitwise AND of this number with another number.===
232      @priority(20)
233      function &&(other:Int64):Int64 {
234          return value && other.value
235      }
236  
237      ===Returns the bitwise AND of this number with another number.===
238      @priority(13)
239      function &&(other:UInt64):UInt64 {
240          return value->builtin_uint64 && other.value
241      }
242  
243      ===Returns the bitwise OR of this number with another number.===
244      @priority(20)
245      function ||(other:Int64):Int64 {
246          return value || other.value
247      }
248  
249      ===Returns the bitwise OR of this number with another number.===
250      @priority(13)
251      function ||(other:UInt64):UInt64 {
252          return value->builtin_uint64 || other.value
253      }
254  
255      ===Returns the bitwise XOR of this number with another number.===
256      @priority(20)
257      function ~~(other:Int64):Int64 {
258          return value ~~ other.value
259      }
260  
261      ===Returns the bitwise XOR of this number with another number.===
262      @priority(13)
263      function ~~(other:UInt64):UInt64 {
264          return value->builtin_uint64 ~~ other.value
265      }
266  
267      ===Returns this number shifted left by the specified number of bits.===
268      @priority(20)
269      function <<(other:Int64):Int64 {
270          return value << other.value
271      }
272  
273      ===Returns this number shifted left by the specified number of bits, without checking for overflow.===
274      @priority(20)
275      function <<&(other:Int64):Int64 {
276          return value <<& other.value
277      }
278  
279      ===Returns this number arithmetic shifted right by the specified number of bits.===
280      @priority(20)
281      function >>(other:Int64):Int64 {
282          return value >> other.value
283      }
284  
285      ===Returns `true` if this number is equal to the given number.===
286      @priority(8)
287      function =(other:Int8):Bit {
288          return value = other.value->builtin_int64
289      }
290  
291      ===Returns `true` if this number is equal to the given number.===
292      @priority(10)
293      function =(other:Int16):Bit {
294          return value = other.value->builtin_int64
295      }
296  
297      ===Returns `true` if this number is equal to the given number.===
298      @priority(12)
299      function =(other:Int32):Bit {
300          return value = other.value->builtin_int64
301      }
302  
303      ===Returns `true` if this number is equal to the given number.===
304      @override
305      @priority(20)
306      function =(other:Int64):Bit {
307          return value = other.value
308      }
309  
310      ===Returns `true` if this number is equal to the given number.===
311      @priority(16)
312      function =(other:Int):Bit {
313          return value = other.value->builtin_int64
314      }
315  
316      ===Returns `true` if this number is not equal to the given number.===
317      @priority(8)
318      function !=(other:Int8):Bit {
319          return value != other.value->builtin_int64
320      }
321  
322      ===Returns `true` if this number is not equal to the given number.===
323      @priority(10)
324      function !=(other:Int16):Bit {
325          return value != other.value->builtin_int64
326      }
327  
328      ===Returns `true` if this number is not equal to the given number.===
329      @priority(12)
330      function !=(other:Int32):Bit {
331          return value != other.value->builtin_int64
332      }
333  
334      ===Returns `true` if this number is not equal to the given number.===
335      @override
336      @priority(20)
337      function !=(other:Int64):Bit {
338          return value != other.value
339      }
340  
341      ===Returns `true` if this number is not equal to the given number.===
342      @priority(16)
343      function !=(other:Int):Bit {
344          return value != other.value->builtin_int64
345      }
346  
347      ===Returns `true` if this number is less than the given number.===
348      @priority(8)
349      function <(other:Int8):Bit {
350          return value < other.value->< other.value->builtin_int64
351      }
352  
353      ===Returns `true` if this number is less than the given number.===
354      @priority(10)
355      function <(other:Int16):Bit {
356          return value < other.value->< other.value->builtin_int64
357      }
358  
359      ===Returns `true` if this number is less than the given number.===
360      @priority(12)
361      function <(other:Int32):Bit {
362          return value < other.value->< other.value->builtin_int64
363      }
364  
365      ===Returns `true` if this number is less than the given number.===
366      @override
367      @priority(20)
368      function <(other:Int64):Bit {
369          return value < other.value
370      }< other.value
371      }
372  
373      ===Returns `true` if this number is less than the given number.===
374      @priority(16)
375      function <(other:Int):Bit {
376          return value < other.value->< other.value->builtin_int64
377      }
378  
379      ===Returns `true` if this number is greater than the given number.===
380      @priority(8)
381      function >(other:Int8):Bit {
382          return value > other.value->builtin_int64
383      }
384  
385      ===Returns `true` if this number is greater than the given number.===
386      @priority(10)
387      function >(other:Int16):Bit {
388          return value > other.value->builtin_int64
389      }
390  
391      ===Returns `true` if this number is greater than the given number.===
392      @priority(12)
393      function >(other:Int32):Bit {
394          return value > other.value->builtin_int64
395      }
396  
397      ===Returns `true` if this number is greater than the given number.===
398      @override
399      @priority(20)
400      function >(other:Int64):Bit {
401          return value > other.value
402      }
403  
404      ===Returns `true` if this number is greater than the given number.===
405      @priority(16)
406      function >(other:Int):Bit {
407          return value > other.value->builtin_int64
408      }
409  
410      ===Returns `true` if this number is greater than or equal to the given number.===
411      @priority(8)
412      function >=(other:Int8):Bit {
413          return value >= other.value->builtin_int64
414      }
415  
416      ===Returns `true` if this number is greater than or equal to the given number.===
417      @priority(10)
418      function >=(other:Int16):Bit {
419          return value >= other.value->builtin_int64
420      }
421  
422      ===Returns `true` if this number is greater than or equal to the given number.===
423      @priority(12)
424      function >=(other:Int32):Bit {
425          return value >= other.value->builtin_int64
426      }
427  
428      ===Returns `true` if this number is greater than or equal to the given number.===
429      @override
430      @priority(20)
431      function >=(other:Int64):Bit {
432          return value >= other.value
433      }
434  
435      ===Returns `true` if this number is greater than or equal to the given number.===
436      @priority(16)
437      function >=(other:Int):Bit {
438          return value >= other.value->builtin_int64
439      }
440  
441      ===Returns `true` if this number is less than or equal to the given number.===
442      @priority(8)
443      function <=(other:Int8):Bit {
444          return value <= other.value->builtin_int64
445      }
446  
447      ===Returns `true` if this number is less than or equal to the given number.===
448      @priority(10)
449      function <=(other:Int16):Bit {
450          return value <= other.value->builtin_int64
451      }
452  
453      ===Returns `true` if this number is less than or equal to the given number.===
454      @priority(12)
455      function <=(other:Int32):Bit {
456          return value <= other.value->builtin_int64
457      }
458  
459      ===Returns `true` if this number is less than or equal to the given number.===
460      @override
461      @priority(20)
462      function <=(other:Int64):Bit {
463          return value <= other.value
464      }
465  
466      ===Returns `true` if this number is less than or equal to the given number.===
467      @priority(16)
468      function <=(other:Int):Bit {
469          return value <= other.value->builtin_int64
470      }
471      ===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.===
472      @class
473      @pre(range.max.asUInt64 - range.min.asUInt64 < Int64.MAX.asUInt64)< Int64.MAX.asUInt64)
474      function [](range:Range<Int64>):ListView<Int64> {
475          return org.frostlang.frost.Int64List(SteppedRange<Int64, Int64>(range.min, range.max, 1, range.inclusive))
476      }
477      ===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.===
478      @class
479      @pre(org.frostlang.frost.Int64List.computeCount(range) > 0)
480      function [](range:SteppedRange<Int64, Int64>):ListView<Int64> {
481          return org.frostlang.frost.Int64List(range)
482      }
483  
484      ===The absolute value of this number.===
485      property abs:Int64
486      function get_abs():Int64 {
487          if self < 0 {
488              return -self
489          }
490          return self
491      }
492      ===
493      A view of this number as a collection of bits, with `bits[0]` as the least significant bit.
494      ===
495      property bits:ListView<Bit>
496      function get_bits():ListView<Bit> { return Bits(self) }
497  
498      ===The square root of this number.===
499      property sqrt:Real64
500      function get_sqrt():Real64 {
501          return toReal64.sqrt
502      }
503  
504      ===Returns the smaller (closest to negative infinity) of this number and another number.===
505      @priority(8)
506      function min(other:Int8):Int64 {
507          if value < other.value->< other.value->builtin_int64 {
508              return value
509          }
510          return other.value->builtin_int64
511      }
512  
513      ===Returns the smaller (closest to negative infinity) of this number and another number.===
514      @priority(10)
515      function min(other:Int16):Int64 {
516          if value < other.value->< other.value->builtin_int64 {
517              return value
518          }
519          return other.value->builtin_int64
520      }
521  
522      ===Returns the smaller (closest to negative infinity) of this number and another number.===
523      @priority(12)
524      function min(other:Int32):Int64 {
525          if value < other.value->< other.value->builtin_int64 {
526              return value
527          }
528          return other.value->builtin_int64
529      }
530  
531      ===Returns the smaller (closest to negative infinity) of this number and another number.===
532      @priority(20)
533      function min(other:Int64):Int64 {
534          if value < other.value {< other.value {
535              return value
536          }
537          return other.value
538      }
539  
540      ===Returns the smaller (closest to negative infinity) of this number and another number.===
541      @priority(16)
542      function min(other:Int):Int64 {
543          if value < other.value->< other.value->builtin_int64 {
544              return value
545          }
546          return other.value->builtin_int64
547      }
548  
549  
550  
551  
552  
553  
554      ===Returns the larger (closest to positive infinity) of this number and another number.===
555      @priority(8)
556      function max(other:Int8):Int64 {
557          if value > other.value->builtin_int64 {
558              return value
559          }
560          return other.value->builtin_int64
561      }
562  
563      ===Returns the larger (closest to positive infinity) of this number and another number.===
564      @priority(10)
565      function max(other:Int16):Int64 {
566          if value > other.value->builtin_int64 {
567              return value
568          }
569          return other.value->builtin_int64
570      }
571  
572      ===Returns the larger (closest to positive infinity) of this number and another number.===
573      @priority(12)
574      function max(other:Int32):Int64 {
575          if value > other.value->builtin_int64 {
576              return value
577          }
578          return other.value->builtin_int64
579      }
580  
581      ===Returns the larger (closest to positive infinity) of this number and another number.===
582      @priority(20)
583      function max(other:Int64):Int64 {
584          if value > other.value {
585              return value
586          }
587          return other.value
588      }
589  
590      ===Returns the larger (closest to positive infinity) of this number and another number.===
591      @priority(16)
592      function max(other:Int):Int64 {
593          if value > other.value->builtin_int64 {
594              return value
595          }
596          return other.value->builtin_int64
597      }
598  
599  
600  
601  
602  
603  
604      @override
605      function get_hash():Int {
606          return Int(value->builtin_int)
607      }
608  
609      ===The number of `1` bits in this number's binary representation.===
610      property bitCount:Int64
611      @external(frostInt64_get_bitCount)
612      function get_bitCount():Int64
613  
614      ===Parses a string as a number in the specified radix. Returns `null` if the parse fails.===
615      @class
616      @pre(radix >= 2 & radix <= 36)
617      function parse(str:String, radix:Int):Int64? {
618          if str.startsWith("-") {
619              def abs := Frost.parse(str[1..], radix)
620              if abs == null {
621                  return null
622              }
623              return -(abs.asInt64)
624          }
625          else {
626              def result := Frost.parse(str, radix)
627              if result == null {
628                  return null
629              }
630              return result.asInt64
631          }
632      }
633  
634      ===
635      This number converted to an Int.
636      If this number is not in the range of an Int, a safety violation occurs.
637      ===
638      property asInt:Int
639      function get_asInt():Int {
640      assert self >= Int.MIN.toInt64 & self <= Int.MAX.toInt64, "Int64(\{self}) cannot be safely converted to Int"
641          return Int(value->builtin_int)
642      }
643  
644      ===
645      This number converted to an Int.
646      This function never fails, even if the number is not in the range of an Int.
647      ===
648      property toInt:Int
649      function get_toInt():Int {
650          return Int(value->builtin_int)
651      }
652  
653      ===
654      This number truncated to an 8 bit signed number.
655      If this number is not in the range of an 8 bit signed number, a safety violation occurs.
656      ===
657      property asInt8:Int8
658      function get_asInt8():Int8 {
659      assert self >= Int8.MIN.toInt64 & self <= Int8.MAX.toInt64, "Int64(\{self}) cannot be safely converted to Int8"
660          return Int8(value->builtin_int8)
661      }
662  
663      ===
664      This number truncated to an 8 bit signed number.
665      This function never fails, even if the number is not in the range of an 8 bit signed number.
666      ===
667      property toInt8:Int8
668      function get_toInt8():Int8 {
669          return Int8(value->builtin_int8)
670      }
671  
672      ===
673      This number truncated to a 16 bit signed number.
674      If this number is not in the range of a 16 bit signed number, a safety violation occurs.
675      ===
676      property asInt16:Int16
677      function get_asInt16():Int16 {
678      assert self >= Int16.MIN.toInt64 & self <= Int16.MAX.toInt64, "Int64(\{self}) cannot be safely converted to Int16"
679          return Int16(value->builtin_int16)
680      }
681  
682      ===
683      This number truncated to a 16 bit signed number.
684      This function never fails, even if the number is not in the range of a 16 bit signed number.
685      ===
686      property toInt16:Int16
687      function get_toInt16():Int16 {
688          return Int16(value->builtin_int16)
689      }
690  
691      ===
692      This number truncated to a 32 bit signed number.
693      If this number is not in the range of a 32 bit signed number, a safety violation occurs.
694      ===
695      property asInt32:Int32
696      function get_asInt32():Int32 {
697      assert self >= Int32.MIN.toInt64 & self <= Int32.MAX.toInt64, "Int64(\{self}) cannot be safely converted to Int32"
698          return Int32(value->builtin_int32)
699      }
700  
701      ===
702      This number truncated to a 32 bit signed number.
703      This function never fails, even if the number is not in the range of a 32 bit signed number.
704      ===
705      property toInt32:Int32
706      function get_toInt32():Int32 {
707          return Int32(value->builtin_int32)
708      }
709  
710      ===
711      This number converted to a UInt.
712      If this number is not in the range of a UInt, a safety violation occurs.
713      ===
714      property asUInt:UInt
715      function get_asUInt():UInt {
716      assert self >= UInt.MIN.toInt64 & self.toUInt64 <= UInt.MAX.toUInt64, "Int64(\{self}) cannot be safely converted to UInt"
717          return UInt(value->builtin_uint)
718      }
719  
720      ===
721      This number converted to a UInt.
722      This function never fails, even if the number is not in the range of a UInt.
723      ===
724      property toUInt:UInt
725      function get_toUInt():UInt {
726          return UInt(value->builtin_uint)
727      }
728  
729      ===
730      This number truncated to an 8 bit unsigned number.
731      If this number is not in the range of an 8 bit unsigned number, a safety violation occurs.
732      ===
733      property asUInt8:UInt8
734      function get_asUInt8():UInt8 {
735      assert self >= UInt8.MIN.toInt64 & self <= UInt8.MAX.toInt64, "Int64(\{self}) cannot be safely converted to UInt8"
736          return UInt8(value->builtin_uint8)
737      }
738  
739      ===
740      This number truncated to an 8 bit unsigned number.
741      This function never fails, even if the number is not in the range of an 8 bit unsigned number.
742      ===
743      property toUInt8:UInt8
744      function get_toUInt8():UInt8 {
745          return UInt8(value->builtin_uint8)
746      }
747  
748      ===
749      This number truncated to a 16 bit unsigned number.
750      If this number is not in the range of a 16 bit unsigned number, a safety violation occurs.
751      ===
752      property asUInt16:UInt16
753      function get_asUInt16():UInt16 {
754      assert self >= UInt16.MIN.toInt64 & self <= UInt16.MAX.toInt64, "Int64(\{self}) cannot be safely converted to UInt16"
755          return UInt16(value->builtin_uint16)
756      }
757  
758      ===
759      This number truncated to a 16 bit unsigned number.
760      This function never fails, even if the number is not in the range of a 16 bit unsigned number.
761      ===
762      property toUInt16:UInt16
763      function get_toUInt16():UInt16 {
764          return UInt16(value->builtin_uint16)
765      }
766  
767      ===
768      This number truncated to a 32 bit unsigned number.
769      If this number is not in the range of a 32 bit unsigned number, a safety violation occurs.
770      ===
771      property asUInt32:UInt32
772      function get_asUInt32():UInt32 {
773      assert self >= UInt32.MIN.toInt64 & self <= UInt32.MAX.toInt64, "Int64(\{self}) cannot be safely converted to UInt32"
774          return UInt32(value->builtin_uint32)
775      }
776  
777      ===
778      This number truncated to a 32 bit unsigned number.
779      This function never fails, even if the number is not in the range of a 32 bit unsigned number.
780      ===
781      property toUInt32:UInt32
782      function get_toUInt32():UInt32 {
783          return UInt32(value->builtin_uint32)
784      }
785  
786      ===
787      This number reinterpreted as a 64 bit unsigned number.
788      If this number is not in the range of a 64 bit unsigned number, a safety violation occurs.
789      ===
790      property asUInt64:UInt64
791      function get_asUInt64():UInt64 {
792      assert self >= UInt64.MIN.toInt64, "Int64(\{self}) cannot be safely converted to UInt64"
793          return UInt64(value->builtin_uint64)
794      }
795  
796      ===
797      This number reinterpreted as a 64 bit unsigned number.
798      This function never fails, even if the number is not in the range of a 64 bit unsigned number.
799      ===
800      property toUInt64:UInt64
801      function get_toUInt64():UInt64 {
802          return UInt64(value->builtin_uint64)
803      }
804  
805      ===
806      This number converted to a 32 bit floating point number.
807      ===
808      property asReal32:Real32
809      function get_asReal32():Real32 {
810          return Real32(value->builtin_float32)
811      }
812  
813      ===
814      This number converted to a 32 bit floating point number.
815      ===
816      property toReal32:Real32
817      function get_toReal32():Real32 {
818          return Real32(value->builtin_float32)
819      }
820  
821      ===
822      This number converted to a 64 bit floating point number.
823      ===
824      property asReal64:Real64
825      function get_asReal64():Real64 {
826          return Real64(value->builtin_float64)
827      }
828  
829      ===
830      This number converted to a 64 bit floating point number.
831      ===
832      property toReal64:Real64
833      function get_toReal64():Real64 {
834          return Real64(value->builtin_float64)
835      }
836  
837      ===Returns this number converted to a decimal string.===
838      @override
839      function get_toString():String {
840          constant max := 20
841          def chars := Pointer<Char8>.alloc(max)
842          var index := max - 1
843          var value := self
844          if value >= 0 {
845              do {
846                  chars[index] := Char8((value % 10 + 48).asUInt8)
847                  value := (value // 10)
848                  index -= 1
849              }
850              while value > 0
851              index += 1
852          }
853          else {
854              do {
855                  chars[index] := Char8((48 - value % 10).asUInt8)
856                  value := (value // 10)
857                  index -= 1
858              }
859              while value < 0< 0
860              chars[index] := "-"
861          }
862          def size := max - index
863          for i in 0 .. size {
864              chars[i] := chars[i + index]
865          }
866          return String(chars, size)
867      }
868  
869      === 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. ===
870      @override
871      function format(fmt:String):String {
872          return Frost.format(value < 0< 0, abs.toUInt64, 0xFFFFFFFFFFFFFFFF, fmt)
873      }
874  }
875