Skip to content

Commit 45582ec

Browse files
committed
Modify multiplication notation
1 parent bd69475 commit 45582ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base/intfuncs.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ ndigits(x::Integer; base::Integer=10, pad::Integer=1) = max(pad, ndigits0z(x, ba
616616
## integer to string functions ##
617617

618618
function bin(x::Unsigned, pad::Int, neg::Bool)
619-
m = 8sizeof(x) - leading_zeros(x)
619+
m = 8 * sizeof(x) - leading_zeros(x)
620620
n = neg + max(pad, m)
621621
a = StringVector(n)
622622
# for i in 0x0:UInt(n-1) # automatic vectorization produces redundant codes
@@ -643,7 +643,7 @@ function bin(x::Unsigned, pad::Int, neg::Bool)
643643
end
644644

645645
function oct(x::Unsigned, pad::Int, neg::Bool)
646-
m = div(8sizeof(x) - leading_zeros(x) + 2, 3)
646+
m = div(8 * sizeof(x) - leading_zeros(x) + 2, 3)
647647
n = neg + max(pad, m)
648648
a = StringVector(n)
649649
i = n
@@ -679,7 +679,7 @@ function dec(x::Unsigned, pad::Int, neg::Bool)
679679
end
680680

681681
function hex(x::Unsigned, pad::Int, neg::Bool)
682-
m = 2sizeof(x) - (leading_zeros(x) >> 2)
682+
m = 2 * sizeof(x) - (leading_zeros(x) >> 2)
683683
n = neg + max(pad, m)
684684
a = StringVector(n)
685685
i = n

0 commit comments

Comments
 (0)