FloatingPointRepresentation

Roundx x round up roundx x round towards zero roundx

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ound up. round(x) = x+ : Round towards zero. round(x) is either x; or x+ , whichever is between zero and x. Round to nearest. round(x) is either x; or x+ , whichever is nearer to x. In the case of a tie, the one with its least signi cant bit equal to zero is chosen. If x is positive, then x; is between zero and x, so round down and round towards zero have the same e ect. If x is negative, then x+ is between zero and x, so it is round up and round towards zero which have the same effect. In either case, round towards zero simply requires truncating the binary expansion, i.e. discarding bits. The most useful rounding mode, and the one which is almost always used, is round to nearest, since this produces the oating point number which is closest to x. In the case of \toy" precision, with x = 1:7, it is clear that round to nearest gives a rounded value of x equal to 1.75. When the word \round" is used without any quali cation, it almost always means \round to nearest". In the more familiar decimal context, if we \round" the number = 3:14159 : : : to four decimal digits, we obtain the result 3...
View Full Document

Ask a homework question - tutors are online