2.2. INNOVACIÓN EMPRESARIAL 1 Concepto de innovación
2.2.4. La innovación como proceso
2.2.4.1. Diferentes propuestas sobre modelos de innovación
New features of C99.
Passing an integer, complex, or other non-floating type to a classification macro yields undefined behavior.
20
7.12.3.1 The fpclassify macro
The classification is based upon the value (not the representation). For example, some architectures allow the same value to be held in either normalized or unnormalized forms; provided that the unnormalized forms can be used in calculations in the same way as normalized ones, and fit into the floating-point model described in §5.2.4.2.2, they should be classified as 25
normal numbers. Similarly, a number should be classified as zero if it behaves like a zero, however many bits it has set. Numbers should be classified as denormalized, infinity or a NaN if they behave in a similar way to the ISO/IEC 60559 ones, even if they have a completely different representation.
If a number behaves in a different or intermediate way, it should be put into an implementation- 30
defined classification. For example, if a number A is such that A > 1.0e20 and A+A == A, but 1.0/A is not 0.0, then it should not be classified as infinity. Similarly, if a number B is such that B > 0.0, but B+0.0 == 0.0, then it should not be classified as a subnormal number.
If an implementation supports signaling NaNs (as an extension), then this function should not 35
7.12.3.2 The isfinite macro
The expression ((x)==(x)) is not the same as isfinite(x) since INFINITY compares equal to itself.
7.12.3.3 The isinf macro
Note that isinf(x) cannot simply be defined as !isfinite(x), because 5
!isfinite(NAN) is true.
7.12.3.4 The isnan macro
If an implementation supports signaling NaNs (as an extension), then this function should not raise invalid for them.
7.12.3.5 The isnormal macro
10
If an implementation supports unnormalized numbers whose value is the same as a normal number, then isnormal should return true for those unnormalized numbers.
7.12.3.6 The signbit macro
This is testing the sign of the value, not the sign of the exponent.
The model of floating-point (§5.2.4.2.2) assumes that there are three distinct fields in a floating- 15
point representation: a sign of the value, a signed exponent, and a significand. This macro converts the encoding of the sign of the value (even if the sign is ignored by the value, such as for NaNs). The model also assumes that the same encoding fields are used for all values.
7.12.4 Trigonometric functions
Implementation note: Trigonometric argument reduction should be performed by a method that 20
causes no catastrophic discontinuities in the error of the computed result. In particular, methods based solely on naive application of a calculation like
x - (2*pi) * (int)(x/(2*pi)) are ill-advised.
7.12.4.4 The atan2 functions
25
The atan2 function is modeled after Fortran’s. It is described in terms of arctan (y/x) for simplicity. The C89 Committee did not wish to complicate the descriptions by specifying in detail how to determine the appropriate quadrant, since that should be obvious from normal mathematical convention. atan2(y,x) is well-defined and finite, even when x is 0; the one ambiguity occurs when both arguments are 0, because at that point any value in the range of the 30
function could logically be selected. Since valid reasons can be advanced for all the different choices that have been made in this situation by various implementations, the Standard preserves the implementor’s freedom to return an arbitrary well-defined value such as 0, to report a domain error, or to return a NaN.
7.12.4.7 The tan functions
5
The tangent function has singularities at odd multiples of π/2, approaching positive infinity from one side and negative infinity from the other. Implementations commonly perform argument reduction using the best machine representation of π; and for arguments to tan sufficiently close to a singularity, such reduction may yield a value on the wrong side of the singularity. In view of such problems, the C89 Committee recognized that tan is an exception to the range error 10
rule (see §7.12.1) that an overflowing result produces HUGE_VAL properly signed.
In C89, the tan function was allowed to return an incorrectly signed HUGE_VAL for a range error due to overflow. In C99, that feature was removed as the committee knows of no
implementations where that could be a problem (it only happens when the number of decimal digits of precision exceeds the decimal value of the exponent of the power of 10 at overflow, 15
e.g., if overflow happens at 1e38, then there needs to be more than 38 decimal digits of precision in machine representations of floating-point numbers). This means, for an accurately computed tan function, it will never have a range error due to overflow.
7.12.6 Exponential and logarithmic functions
7.12.6.2 The exp2 functions 20
Since many computers use a float radix that is a power of 2, it is expected that base-2 exponentials will be useful (and may even be more accurate than base-e or base-10 exponentials).
7.12.6.3 The expm1 functions
For x values near zero, expm1(x) is expected to be more accurate than exp(x)-1. In 25
particular, if |x| is less than DBL_EPSILON, exp(x)-1 is typically zero (due to limited precision in exp(x)), while expm1(x) should be x.
7.12.6.4 The frexp functions
The functions frexp, ldexp, and modf are primitives used by the remainder of the library. There was some sentiment for dropping them for the same reasons that ecvt, fcvt, and gcvt 30
were dropped, but their adherents rescued them for general use. Their use is problematic: on non-binary architectures, ldexp may lose precision and frexp may be inefficient.
7.12.6.6 The ldexp functions
7.12.6.7 The log functions
Whether log(0.0) is a domain error or a range error is arguable. The choice in the Standard, range error, is for compatibility with IEC 60559. Some such implementations would represent the result as –∞, in which case no error is raised.
7.12.6.8 The log10 functions
5
See §7.12.6.7.
7.12.6.9 The log1p functions
New feature for C99. For x values near zero, log1p(x) is expected to be more accurate than log(1+x). In particular, if |x| is less than DBL_EPSILON, log(1+x) is typically zero (due to limited precision in the expression 1+x), while log1p(x) should be x.
10
7.12.6.10 The log2 functions
New feature for C99. Since many computers use a float radix that is a power of 2, it is expected that base-2 logarithms will be useful (and may even be more accurate than base-e or base-10 logarithms).
7.12.6.11 The logb functions
15
New feature for C99. The treatment of subnormal x follows the recommendation in IEEE 854, which differs from IEEE 754 on this point. Even 754 implementations should follow this definition rather than the one recommended (not required) by 754.
7.12.6.12 The modf functions
See §6.12.6.4. 20
7.12.6.13 The scalbn and scalbln functions
New feature for C99. In earlier versions of the specification, this function was called scalb. The name was changed to avoid conflicting with the Single Unix scalb function whose second argument is double instead of int. Single Unix’s scalb was not included in C99 as its specification of certain special cases is inconsistent with the C99 approach and because the 25
scalbn and scalbln functions were considered sufficient.
scalbln, whose second parameter has type longint is provided because the factor required to scale from the smallest positive floating-point value to the largest finite one, on many
7.12.7 Power and absolute-value functions
7.12.7.1 The cbrt functions
New feature for C99. For some applications, a true cube root function, which returns negative results for negative arguments, is more appropriate than pow(x,1.0/3.0), which returns a NaN for x less than 0.
5
7.12.7.2 The fabs functions
Adding an absolute value operator was rejected by the C89 Committee. An implementation can provide a built-in function for efficiency.
7.12.7.3 The hypot functions
New feature for C99. It is expected that hypot(x,y) will be more accurate than 10
sqrt(x*x+y*y), in particular, when both x and y are small (near DBL_MIN), or when either x or y is large (near DBL_MAX).
7.12.7.5 The sqrt functions
IEC 60559, unlike the Standard, requires sqrt(-0.) to return a negatively signed magnitude- zero result. This is an issue on implementations that support a negative floating zero. The 15
Standard specifies that taking the square root of a negative number (in the mathematical sense of less than 0) is a domain error which requires the function to return an implementation-defined value. This rule permits implementations to support either the IEC 60559 or vendor-specific floating-point representations.