File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -44,20 +44,6 @@ export function to_string(term) {
44
44
return term . toString ( ) ;
45
45
}
46
46
47
- export function float_to_string ( float ) {
48
- const string = float . toString ( ) . replace ( "+" , "" ) ;
49
- if ( string . indexOf ( "." ) >= 0 ) {
50
- return string ;
51
- } else {
52
- const index = string . indexOf ( "e" ) ;
53
- if ( index >= 0 ) {
54
- return string . slice ( 0 , index ) + ".0" + string . slice ( index ) ;
55
- } else {
56
- return string + ".0" ;
57
- }
58
- }
59
- }
60
-
61
47
export function int_to_base_string ( int , base ) {
62
48
return int . toString ( base ) . toUpperCase ( ) ;
63
49
}
@@ -673,6 +659,20 @@ export function inspect(v) {
673
659
return new Inspector ( ) . inspect ( v ) ;
674
660
}
675
661
662
+ export function float_to_string ( float ) {
663
+ const string = float . toString ( ) . replace ( "+" , "" ) ;
664
+ if ( string . indexOf ( "." ) >= 0 ) {
665
+ return string ;
666
+ } else {
667
+ const index = string . indexOf ( "e" ) ;
668
+ if ( index >= 0 ) {
669
+ return string . slice ( 0 , index ) + ".0" + string . slice ( index ) ;
670
+ } else {
671
+ return string + ".0" ;
672
+ }
673
+ }
674
+ }
675
+
676
676
class Inspector {
677
677
#references = new Set ( ) ;
678
678
@@ -822,11 +822,12 @@ class Inspector {
822
822
}
823
823
824
824
#bit_array( bits ) {
825
- let acc = "<<" ;
826
825
if ( bits . bitSize === 0 ) {
827
- return acc ;
826
+ return "<<>>" ;
828
827
}
829
828
829
+ let acc = "<<" ;
830
+
830
831
for ( let i = 0 ; i < bits . byteSize - 1 ; i ++ ) {
831
832
acc += bits . byteAt ( i ) . toString ( ) ;
832
833
acc += ", " ;
You can’t perform that action at this time.
0 commit comments