Skip to content

Commit

Permalink
解决 log2 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wysaid committed Dec 9, 2023
1 parent ec9d787 commit b83ed0b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions demo/egejulia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
* (编译后改为scr后缀使用)
*/

#ifdef _CRT_FUNCTIONS_REQUIRED
#undef _CRT_FUNCTIONS_REQUIRED /// 解决在高版本 visual studio中, log2 与系统定义的版本冲突的问题
#endif

#include "graphics.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -97,7 +93,7 @@ const double gc_lb = log(2.0);
* @param d 指数
* @return 对数值
*/
double log2(double d) {
double myLog2(double d) {
return log(d) / gc_lb;
}

Expand All @@ -109,7 +105,7 @@ void InitLog()
for (int i=0; i<(18 * 18) * 32; ++i)
{
double r = i / col_ins;
logmap[i] = 1 - log2(log2(r)/2);
logmap[i] = 1 - myLog2(myLog2(r)/2);
}
}

Expand Down

0 comments on commit b83ed0b

Please sign in to comment.