@@ -182,12 +182,12 @@ for w in (32,64,128)
182
182
end
183
183
184
184
function Base. show (io:: IO , x:: $BID )
185
- isnan (x) && (write (io, " NaN" ); return )
186
- isinf (x) && (write (io, signbit (x) ? " -Inf" : " Inf" ); return )
187
- x == 0 && (write (io, signbit (x) ? " -0.0" : " 0.0" ); return )
185
+ isnan (x) && (print (io, " NaN" ); return )
186
+ isinf (x) && (print (io, signbit (x) ? " -Inf" : " Inf" ); return )
187
+ x == 0 && (print (io, signbit (x) ? " -0.0" : " 0.0" ); return )
188
188
tostring (x)
189
189
if _buffer[1 ] == UInt8 (' -' )
190
- write (io, ' -' )
190
+ print (io, ' -' )
191
191
end
192
192
normalized_exponent = exponent10 (x)
193
193
lastdigitindex = Compat. findfirst (isequal (UInt8 (' E' )), _buffer) - 1
@@ -197,29 +197,29 @@ for w in (32,64,128)
197
197
if normalized_exponent >= 0
198
198
if normalized_exponent >= lastnonzeroindex - 2
199
199
GC. @preserve _buffer unsafe_write (io, pointer (_buffer, 2 ), lastnonzeroindex - 1 )
200
- writezeros (io, normalized_exponent - lastnonzeroindex + 2 )
201
- write (io, " .0" )
200
+ printzeros (io, normalized_exponent - lastnonzeroindex + 2 )
201
+ print (io, " .0" )
202
202
else
203
203
GC. @preserve _buffer unsafe_write (io, pointer (_buffer, 2 ), normalized_exponent + 1 )
204
- write (io, ' .' )
204
+ print (io, ' .' )
205
205
GC. @preserve _buffer unsafe_write (io, pointer (_buffer, normalized_exponent + 3 ), lastnonzeroindex - normalized_exponent - 2 )
206
206
end
207
207
else
208
- write (io, " 0." )
209
- writezeros (io, - normalized_exponent - 1 )
208
+ print (io, " 0." )
209
+ printzeros (io, - normalized_exponent - 1 )
210
210
GC. @preserve _buffer unsafe_write (io, pointer (_buffer, 2 ), lastnonzeroindex - 1 )
211
211
end
212
212
else
213
213
# %e
214
- write (io, _buffer[2 ], ' .' )
214
+ print (io, Char ( _buffer[2 ]) , ' .' )
215
215
if lastnonzeroindex == 2
216
- write (io, ' 0' )
216
+ print (io, ' 0' )
217
217
else
218
218
GC. @preserve _buffer unsafe_write (io, pointer (_buffer, 3 ), lastnonzeroindex - 2 )
219
219
end
220
- write (io, ' e' )
220
+ print (io, ' e' )
221
221
if normalized_exponent < 0
222
- write (io, ' -' )
222
+ print (io, ' -' )
223
223
normalized_exponent = - normalized_exponent
224
224
end
225
225
b_lb = div (normalized_exponent, 10 )
@@ -230,7 +230,7 @@ for w in (32,64,128)
230
230
r = normalized_exponent
231
231
while b > 0
232
232
q, r = divrem (r, b)
233
- write (io, UInt8 ( ' 0' ) + (q % UInt8) )
233
+ print (io, ' 0' + q )
234
234
b = div (b, 10 )
235
235
end
236
236
end
@@ -479,9 +479,9 @@ macro d64_str(s, flags...) parse(Dec64, s) end
479
479
macro d128_str (s, flags... ) parse (Dec128, s) end
480
480
481
481
# for zero-padding in printing routines above
482
- function writezeros (io:: IO , n:: Int )
482
+ function printzeros (io:: IO , n:: Int )
483
483
for i = 1 : n
484
- write (io, UInt8 ( ' 0' ) )
484
+ print (io, ' 0' )
485
485
end
486
486
end
487
487
0 commit comments