Name:

round rounds a number to a floating-point format.

Usage:

round(x,n,mode) : (constant, integer, RN|RZ|RU|RD) -> constant round(x,format,mode) : (constant, HP|halfprecision|SG|single|D|double|DE|doubleextended|DD|doubledouble|QD|quad|TD|tripledouble, RN|RZ|RU|RD) -> constant

Parameters:

Description:

Example 1:

   > display=binary!;
   > round(Pi,20,RN);
   1.100100100001111111_2 * 2^(1)

Example 2:

   > printdouble(round(exp(17),53,RU));
   0x417709348c0ea4f9
   > printdouble(D(exp(17)));
   0x417709348c0ea4f9

Example 3:

   > display=binary!;
   > a=2^(-1100);
   > round(a,53,RN);
   1_2 * 2^(-1100)
   > round(a,D,RN);
   0
   > double(a);
   0
See also: RN, RD, RU, RZ, halfprecision, single, double, doubleextended, doubledouble, quad, tripledouble, roundcoefficients, roundcorrectly, printdouble, printsingle, ceil, floor, nearestint
Go back to the list of commands