## Names:

doubleextended, DE computes the nearest number with 64 bits of mantissa.

## Description:

• doubleextended is a function that computes the nearest floating-point number with 64 bits of mantissa to a given number. Since it is a function, it can be composed with other Sollya functions such as exp, sin, etc.
• It does not handle subnormal numbers. The range of possible exponents is the range used for all numbers represented in Sollya (e.g. basically the range used in the library MPFR).
• Since it is a function and not a command, its behavior is a bit different from the behavior of round(x,64,RN) even if the result is exactly the same. round(x,64,RN) is immediately evaluated whereas doubleextended(x) can be composed with other functions (and thus be plotted and so on).
• Be aware that doubleextended cannot be used as a constant to represent a format in the commands roundcoefficients and implementpoly (contrary to D, DD,and TD). However, it can be used in round.

## Example 1:

> display=binary!;
> DE(0.1);
1.100110011001100110011001100110011001100110011001100110011001101_2 * 2^(-4)
> round(0.1,64,RN);
1.100110011001100110011001100110011001100110011001100110011001101_2 * 2^(-4)

## Example 2:

> D(2^(-2000));
0
> DE(2^(-2000));
8.7098098162172166755761954947788722958591037427053e-603

## Example 3:

> verbosity=1!;
> f = sin(DE(x));
> f(pi);
Warning: rounding has happened. The value displayed is a faithful rounding of the true result.
-5.0165576126683320235573270803307570138315616702549e-20
> g = sin(round(x,64,RN));
Warning: at least one of the given expressions or a subexpression is not correctly typed
or its evaluation has failed because of some error on a side-effect.
Go back to the list of commands