10/28/2023 0 Comments Overflow error vs roundoff errorHowever, in practice, these approximations are usually accurate enough for most applications. This means that for numbers that require an infinite number of bits to represent exactly, such as irrational numbers like pi, the computer can only represent an approximation of the number. Modern computers use finite-precision arithmetic to perform computations, which means that they can only represent numbers with a limited number of bits. I cound not answer ur problem and look around for a bit and found this: I also recommend this explanation of floating point representation: Try clicking the 1s or 0s to see what happens when they take on different values. It currently represents 0.75 in 64-bit floating point. I find it helpful to see what happens when you change bits in a representation. If it goes above that, then the exponent can be increased instead. The key thing here is that the mantissa only ever needs to be between 1.0 and 2.0 (excluding 2). In this case, there is a 1 in the first bit, so this mantissa is 1.5. The goal is for those bits to be able to represent values between 0 and 1, which then is considered a mantissa between 1 and 2. According to the floating point standard, the first bit represents 1/2 (0.5), the second bit represents 1/4, the third bit represents 1/8, etc. 1022-1023 is -1, which is indeed the exponent. According to the floating point standard, the exponent is calculated by subtracting 1023 from that value. The next 11 bits represents the exponent -1: The first bit represents the sign, where 0 is positive. The floating point representation of 0.750 in binary needs to include the sign (positive/negative), the mantissa, and the exponent. The number -1 is called the "exponent" (as per normal math term). The number 1.5 is called either the "mantissa" or the "significand". Let's step through how the computer actually represents that number in floating point representation and see if that helps. From the author: Apologies for the confusing explanation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |