### 5.2.1. Arithmetic on numbers in a particular format

The routines in Table 5.1 perform arithmetic on numbers in a particular format. Arguments and results are always in the same format.

Table 5.1. Arithmetic routines

FunctionArgument typesResult typeOperation
`_fadd`2 floatfloatReturn x plus y
`_fsub`2 floatfloatReturn x minus y
`_frsb`2 floatfloatReturn y minus x
`_fmul`2 floatfloatReturn x times y
`_fdiv`2 floatfloatReturn x divided by y
`_frdiv`2 floatfloatReturn y divided by x
`_frem`2 floatfloatReturn remainder[1] of x by y
`_frnd`floatfloatReturn x rounded to an integer[2]
`_fsqrt`floatfloatReturn square root of x
`_dadd`2 doubledoubleReturn x plus y
`_dsub`2 doubledoubleReturn x minus y
`_drsb`2 doubledoubleReturn y minus x
`_dmul`2 doubledoubleReturn x times y
`_ddiv`2 doubledoubleReturn x divided by y
`_drdiv`2 doubledoubleReturn y divided by x
`_drem`2 doubledoubleReturn remaindera of x by y
`_drnd`doubledoubleReturn x rounded to an integerb
`_dsqrt`doubledoubleReturn square root of x

[1] Functions that perform the IEEE 754 remainder operation. This is defined to take two numbers, x and y, and return a number z such that z = x – n * y, where n is an integer. To return an exactly correct result, n is chosen so that z is no bigger than half of x (so that z might be negative even if both x and y are positive). The IEEE 754 remainder function is not the same as the operation performed by the C library function `fmod`, where z always has the same sign as x. Where the above specification gives two acceptable choices of n, the even one is chosen. This behavior occurs independently of the current rounding mode.

[2] Functions that perform the IEEE 754 round-to-integer operation. This takes a number and rounds it to an integer (in accordance with the current rounding mode), but returns that integer in the floating-point number format rather than as a C int variable. To convert a number to an int variable, you must use the `_ffix` routines described in Table 5.2