소스 검색

real: fix a bug in the real number multiplication when one of the arguments

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

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

@@ -263,6 +263,13 @@ real real::operator *(real const &x) const
{
real ret;

if (m_signexp << 1 == 0 || x.m_signexp << 1 == 0)
{
ret = (m_signexp << 1 == 0) ? *this : x;
ret.m_signexp ^= x.m_signexp & 0x80000000u;
return ret;
}

ret.m_signexp = (m_signexp ^ x.m_signexp) & 0x80000000u;
int e = (m_signexp & 0x7fffffffu) - (1 << 30) + 1
+ (x.m_signexp & 0x7fffffffu) - (1 << 30) + 1;


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