Skip to content

Commit

Permalink
FIX: old log-2 is for log-e, so only need modify name
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbegin authored and qtxie committed Jun 22, 2020
1 parent a0f9222 commit 8bc2617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Library/Stream-IO/Stream-IO-core.reds
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ getSBitsLength: func[
][
if value = 0 [return 0]
if value < 0 [value: 0 - value]
2 + as integer! (log-2 as float! value) / 0.6931471805599453
2 + as integer! (log-e as float! value) / 0.6931471805599453
]
getUBitsLength: func[
"Returns number of bits needed to store unsigned integer value"
Expand All @@ -178,7 +178,7 @@ getUBitsLength: func[
][
if value = 0 [return 0]
if value < 0 [value: 0 - value]
1 + as integer! (log-2 as float! value) / 0.6931471805599453
1 + as integer! (log-e as float! value) / 0.6931471805599453
]


Expand Down
2 changes: 1 addition & 1 deletion Scripts/mandelbrot-fast.red
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fast-mandelbrot: routine [
i: mandelbrot-iter x y iterations

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

0 comments on commit 8bc2617

Please sign in to comment.