Floating Point

14. Floating Point

14.1When I set a float variable to 3.1, why is printf printing it as 3.0999999?

14.2Why is sqrt(144.) giving me crazy numbers?

14.3I keep getting ``undefined: sin''compilation errors.

14.4My floating-point calculations are acting strangely and giving medifferent answers on different machines.

14.5What's a good way to check for ``close enough''floating-point equality?

14.6How do I round numbers?

14.7Where is C'sexponentiation operator?

14.8The pre-#defined constant M_PI seems to be missing from <math.h>.

14.9How do Itest forIEEE NaNand other special values?

14.11What's a good way to implement complex numbers in C?

14.12I'm looking for somemathematical library code.

14.13I'm having trouble with a Turbo C program which crashes and sayssomething like``floating point formats not linked.''


top