From e58253a07873b65f847804a607585695d308fcc5 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Tue, 30 Oct 2012 13:07:38 +0000 Subject: [PATCH] fixed: in Big::FromDouble(double value) (32 bit version) buffer overflow in referencing to UInt<2> (instead of m.table[2] should be m.table[0]) this was used when: E=0 and F is nonzero (double "unnormalized" values) it produced incorrect mantissa (on about 8th decimal digit up) git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@435 e52654a7-88a9-db11-a3e9-0013d4bc506e --- ttmath/ttmathbig.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index 9361a6e..45793b4 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2006-2011, Tomasz Sowa + * Copyright (c) 2006-2012, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2644,7 +2644,7 @@ public: FromDouble_SetExpAndMan((temp.u[1] & 0x80000000u) != 0, e - 1022 - man*TTMATH_BITS_PER_UINT + 1 - moved, 0, - m.table[1], m.table[2]); + m.table[1], m.table[0]); } else {