• No se han encontrado resultados

Otros conceptos que relacionan la innovación.

2.2. INNOVACIÓN EMPRESARIAL 1 Concepto de innovación

2.2.3. Otros conceptos que relacionan la innovación.

Whether underflow should be considered a range error and cause errno to be set is specified as implementation-defined since detection of underflow is inefficient on some systems. In C99, 25

errno is no longer required to be set to EDOM or ERANGE because that is an impediment to optimization.

The Standard has been crafted to neither require nor preclude any popular floating-point implementation. This principle affects the definition of domain error: an implementation may define extra domain errors to deal with floating-point arguments such as infinity or “not-a- 30

number” (NaN).

The C89 Committee considered the adoption of the matherr capability from UNIX System V. In this feature of that system’s math library, any error such as overflow or underflow results in a call from the library function to a user-defined exception handler named matherr. The C89 Committee rejected this approach for several reasons:

35

• This style is incompatible with popular floating-point implementations such as IEC 60559, with its special return codes, or that of VAX/VMS.

• It conflicts with the error-handling style of Fortran, thus making it more difficult to translate useful bodies of mathematical code from that language to C.

• It requires the math library to be reentrant since math routines could be called from matherr, which may complicate some implementations.

• It introduces a new style of library interface: a user-defined library function with a 5

library-defined name. Note, by way of comparison, the signal and exit handling mechanisms, which provide a way of “registering” user-defined functions.

In C89, the math library functions had one method to indicate errors: setting errno. In C99, a second method is available: raising floating-point exceptions. An implementation may do either or both and the choice is indicated by the value of the macro math_errhandling. For 10

backward compatibility, an implementation may wish to use errno. QUIET CHANGE in C99

errno is no longer required to be altered when an error occurs in the math library. For performance on machines whose floating-point raises exceptions, an implementation may wish to use floating-point exceptions as the means to indicate math errors (for some

15

implementations, it takes longer to set errno than to compute a sqrt and set any exception flags).

Exception flags (required by IEC 60559) are more discriminating than errno, as they provide a separate indication for each supported floating-point exception. Unlike errno, exception flags are not overwritten with other error indications.

20

An implementation might provide two versions of the math library — one that uses errno as a means to indicate errors and a second that uses the floating-point exceptions as error indicators. Then, the user links in the version of the math library whose error style matches their needs. Finally, an implementation can provide a math library that sets errno and raises floating-point exceptions for error indication. This meets the needs of both kinds of user, but can result in 25

slower performance.

For a given program execution, the method used to indicate math library errors is invariant. That is, the user does not need to worry about some math functions using one method and other math functions using the other method, nor that the same math function first uses one method and later uses the other method.

30

The C99 committee considered other methods to indicate errors: matherr function found in some existing implementations and LIA-1's trap handlers. These were not adopted by the committee; in particular, the committee reaffirmed that the math library is atomic (as seen from the user's program). If an implementation were to add them as an extension, it is expected that additional macros beginning with MATH_ERR would be defined by the implementation and that their values 35

§7.12.1 allows implementations to define domain and range errors in addition to the ones required in §7.12. Annex F specifies the invalid and divide-by-zero exceptions for IEC 60559 implementations. Non IEC 60559 implementations are not required to support the invalid or divide-by-zero exceptions. In addition, a requirement has been added to §7.12.1 that an implementation report domain and range errors either through errno or through exception flags 5

or perhaps, but not necessarily, through both.

Implementations, as an extension, may also use raising SIGFPE and signal handlers as another independent method of error reporting.

extraordinary roundoff error means more than ordinary roundoff. For example, for IEEE-754 in round to nearest, the normal error is at most 0.5 unit in the last place (ULP). But for finite 10

numbers larger than the largest finite number, the error is more than 0.5 ulp to either of the two possible machine representations. For subnormal numbers, since the precision is reduced, the error is larger than 0.5 ulp. And for numbers smaller than the smallest finite number, the error is more than 0.5 ulp to either of the two possible machine representations.