소스 검색

math: fix an infinite loop in the real number print function.

legacy
Sam Hocevar sam 13 년 전
부모
커밋
a949a2cd08
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. +6
    -0
      src/real.cpp

+ 6
- 0
src/real.cpp 파일 보기

@@ -1274,6 +1274,12 @@ void real::print(int ndigits) const
x = -x;
}

if (!x)
{
printf("0.0\n");
return;
}

/* Normalise x so that mantissa is in [1..9.999] */
/* FIXME: better use int64_t when the cast is implemented */
int exponent = ceil(log10(x));


불러오는 중...
취소
저장