Chapter 3 Ada Language Reference© National Instruments Corporation 3-29 AutoCode Referencefunction “>=” is new SA_FIXED_GENERICS.GREATEREQUAL(SA_FIXED.RT_SSHORT14,SA_FIXED.RT_SSHORT08);--pragma inline (">=");function ">=" (LEFT, RIGHT : SA_FIXED.RT_SSHORT13) return BOOLEANrenames SA_FIXED.">=";--pragma inline (">=");function RT_US11 is newSA_FIXED_GENERICS.FLOATFIXEDCAST(SA_FIXED.RT_USHORT11);--pragma inline (RT_US11);-- Conversion Function Instantiations --function RT_US13r is newSA_FIXED_GENERICS.FLOATFIXEDCAST_ROUND(SA_FIXED.RT_USHORT13);--pragma inline (RT_US13r);function RT_SS12_It is newSA_FIXED_GENERICS.INTCAST_TRUNC(SA_FIXED.RT_SSHORT12);--pragma inline (RT_SS12_It);end RT_FIXED_OPERATORS;Addition and Subtraction FunctionsThe FIXED_ADD and FIXED_SUB generic functions implement additionand subtraction of fixed-point types. Unlike the predefined Ada fixed-pointoperators, these generics support mixed-type operators, that is, the types ofthe operands do not have to be the same. To achieve results as accurate aspossible without introducing overflow requires the use of an intermediatetype in the calculation. The intermediate type is chosen such that thefollowing properties are maintained: the values of each operand do notoverflow when converted to the intermediate type; the result of theoperation does not overflow when represented in the intermediate type.If such an intermediate type can be found for the two operands of theoperation, the result is guaranteed to be exact. Therefore, addition andsubtraction uses the intermediate type for the calculation of the result suchthat the operations are defined as:c = a + b ==> c = RESULT_TYPE( IT(a) + IT(b) )c = a - b ==> c = RESULT_TYPE( IT(a) - IT(b) )The two operands are converted to the intermediate type (IT), and thenthe operation is performed. Then, the result is converted to the result type(RESULT_TYPE). Loss of significance can occur when converting to theresult type.