Skip to content

Commit 8bc2617

Browse files
bitbeginqtxie
authored andcommitted
FIX: old log-2 is for log-e, so only need modify name
1 parent a0f9222 commit 8bc2617

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Library/Stream-IO/Stream-IO-core.reds

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ getSBitsLength: func[
169169
][
170170
if value = 0 [return 0]
171171
if value < 0 [value: 0 - value]
172-
2 + as integer! (log-2 as float! value) / 0.6931471805599453
172+
2 + as integer! (log-e as float! value) / 0.6931471805599453
173173
]
174174
getUBitsLength: func[
175175
"Returns number of bits needed to store unsigned integer value"
@@ -178,7 +178,7 @@ getUBitsLength: func[
178178
][
179179
if value = 0 [return 0]
180180
if value < 0 [value: 0 - value]
181-
1 + as integer! (log-2 as float! value) / 0.6931471805599453
181+
1 + as integer! (log-e as float! value) / 0.6931471805599453
182182
]
183183

184184

Scripts/mandelbrot-fast.red

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fast-mandelbrot: routine [
5454
i: mandelbrot-iter x y iterations
5555

5656
pix/value: either i > iterations [FF000000h][
57-
c: 3.0 * (log-2 as-float i) / log-2 as-float (iterations - 1)
57+
c: 3.0 * (log-e as-float i) / log-e as-float (iterations - 1)
5858
case [
5959
c < 1.0 [FF000000h or (FFh and (as-integer 255.0 * c) << 16)]
6060
c < 2.0 [FFFF0000h or (FFh and (as-integer 255.0 * (c - 1.0)) << 8)]

0 commit comments

Comments
 (0)