Minimizing Fractional Errors in Floating Point Number

تاريخ النشر

2010

نوع المقالة

رسالة ماجستير

عنوان الرسالة

كلية العلوم - جامغة طرابلس

المؤلفـ(ون)

ناهد فتحي محمد فرح

ملخص

تدعم لغات البرمجة أعداد النقطة العائمة كنوع بيانات متضمن باللغة built-in data type. إلا أن تمثيل و دقة أعداد النقطة العائمة قد يختلف من لغة إلى أخرى ومن حاسوب إلى آخر. قسمة الأعداد الصحيحة قد تُنتج قيمة بالنقطة العائمة التي في كثير من الحالات يمكن أن تسكّن accommodated بالكامل في الحيز المخصص لها بذاكرة الحاسوب أو أنها تستمر بشكل لانهائي والذي قد ينتج عنه فقد في قيمة الناتج. إذا أخذ الناتج لتجرى عليه حسابات أخرى متتالية فتزيد فجوة الخطأ والتأثير قد لا يكون مقبولاً.في هذا البحث نقدم حلاً مستنداً على تمثيل أجزاء العدد الكسري (الجزء العشريmantissa ، الأساس base، الأس exponent) باستخدام أعداد صحيحة على شكل كسر اعتيادي. في هذه الحالة سنحصل على ثلاثة أعداد: العدد الصحيح Integer value والبسط Numerator والمقام Denominator. مع توضيح طرق إجراء العمليات الحسابية على ضوء هذا التمثيل.كنتيجة لهذا البحث ستكون هذه الطريقة في تمثيل الأعداد الكسرية تمثيلاً كاملاً دون فقدان لشكل الكسر أو جزءًا من قيمته، وتقليل الخطأ التراكمي الناتج عن تتالي العمليات الحسابية. وقد تم إعداد بعض الأمثلة البرمجية للتحقق من فعالية هذه الطريقة ومقارنة نتائجها مع نتائج التمثيل العشري المتبع للنقطة العائمة.

Abstract

Programming languages support floating point numbers as a built-in data type. However the representation of floating point numbers differs from one language to another.Integer division may result in floating point value that in many cases can be fully accommodated in computer memory or it goes infinitely which produces a lost in the output value. If the result is then taken for further calculations the gape of the error increases and the effect may not be acceptable.In this research a solution is proposal based on representing fractional numbers (mantissa, base and exponent) using integer numbers format. In this case we get three parts: the Integer value, the Numerator value and the Denominator value. The operations on such representation are also introduced. This representation is evaluated and compared with the traditional (Mantissa) representation. Sample programs using C++ language are developed showing how this representation can be used and how fractional numbers are declared and used, with comparison with the normal representation.