mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 04:00:02 +02:00
[poincare] Integer: fix approximate, round instead of truncate integers
to closest float
This commit is contained in:
committed by
EmilieNumworks
parent
97df52d0c5
commit
d9150d4faa
@@ -531,11 +531,6 @@ T Integer::approximate() const {
|
||||
}
|
||||
digitIndex++;
|
||||
}
|
||||
// TODO: Here, we just cast the Integer in float(double). We should round it
|
||||
// to the closest float(double). To do so, we should keep a additional bit
|
||||
// at the end of the mantissa and add it to the mantissa; do not forget to
|
||||
// shift the mantissa if the rounding increase the length in bits of the
|
||||
// mantissa.
|
||||
|
||||
T result = IEEE754<T>::buildFloat(sign, exponent, mantissa);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user