Some library functions in the C language are optimized at compile time.
As in GCC
LOG2 (1) is optimized to be constant
But log2 (20) evaluates values at run time
Fabs will be optimized into machine (assembler) Instructions Fabs
So even if you don't have header files that contain fabs declarations, you can successfully compile and run
Programs with fabs functions
.....................................................................
(int&) A and * ((int*) &a) are the same
Think of the 32 digits on the &a address as Int.
..................................................................
The C language standard provides a data type long long
The current platform, long Long is a 8-byte 64-bit integer
The range of numbers represented is [ -2^63, 2^63-1]
So how do I enter the output of this type of data?
Long long test;
scanf ("%lld", &test);
printf ("%lld", test);
Under Gcc4+linux (2.6.15), such input and output is no problem.
But under Windows
Some old compilers, this code doesn't work correctly.
The reason is that c-runtime-library does not support this parameter
Underneath the xp+devc++4.9.
This has to become a special way of Windows. Specify type
%LLD have to be replaced with%I64D.
---------------------------------------------------------------
How to read all the memory data in a double
typedef Union
{
Double value;
struct
{
unsigned int lsw;
unsigned int msw;
} parts;
} Ieee_double_shape_type;
/* Get two bit ints from a double. */
#define Extract_words (IX0,IX1,D)
do {
Ieee_double_shape_type Ew_u;
Ew_u.value = (d);
(ix0) = EW_U.PARTS.MSW;
(ix1) = EW_U.PARTS.LSW;
} while (0)
How to output a complete floating-point number
Double D1;
Char str1[64];
d1=0.681638760023334166733241952779893935; 36
Dtoa (str1, D1, 40);
printf ("D1 =%s \ r \ n", str1);
---------------------------------------------------------------