C Standard Library Collection Of Built In Functions Tutorials Point instant download
C Standard Library Collection Of Built In Functions Tutorials Point instant download
https://ebookbell.com/product/c-standard-library-collection-of-
built-in-functions-tutorials-point-32852294
https://ebookbell.com/product/c-standard-library-collection-of-
builtin-functions-tutorials-point-12128228
https://ebookbell.com/product/c-standard-library-quick-reference-
peter-van-weert-marc-gregoire-33556576
https://ebookbell.com/product/c-standard-library-practical-tips-1st-
edition-greg-reese-1648652
https://ebookbell.com/product/the-c-standard-library-a-tutorial-and-
reference-2nd-edition-nicolai-m-josuttis-2586504
The C Standard Library Fourth Edition Includes C23 4th Edition Rainer
Grimm
https://ebookbell.com/product/the-c-standard-library-fourth-edition-
includes-c23-4th-edition-rainer-grimm-49419132
https://ebookbell.com/product/the-c-standard-library-rainer-
grimm-50194818
The C Standard Library Fourth Edition Includes C23 4th Edition Rainer
Grimm
https://ebookbell.com/product/the-c-standard-library-fourth-edition-
includes-c23-4th-edition-rainer-grimm-48367930
The C Standard Library Fourth Edition Includes C23 4th Edition Rainer
Grimm
https://ebookbell.com/product/the-c-standard-library-fourth-edition-
includes-c23-4th-edition-rainer-grimm-49417210
https://ebookbell.com/product/the-c-standard-library-rainer-
grimm-50193198
C Standard Library
C is the most widely used computer language that keeps fluctuating at number one scale
of popularity along with Java programming language which is also equally popular and
most widely used among modern software programmers.
The C Standard Library is a set of C built-in functions, constants and header files
like <assert.h>, <ctype.h>, etc. This library will work as a reference manual for C
programmers.
Audience
The C Standard Library is a reference for C programmers to help them in their projects
related to system programming. All the C functions have been explained in a user-
friendly way and they can be copied and pasted in your C projects.
Prerequisites
A basic understanding of the C Programming language will help you in understanding the
C built-in functions covered in this library.
All the content and graphics published in this e-book are the property of Tutorials Point
(I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or
republish any contents or a part of contents of this e-book in any manner without written
consent of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely
as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I)
Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of
our website or its contents including this tutorial. If you discover any errors on our
website or in this tutorial, please notify us at [email protected]
i
C Standard Library
Table of Contents
About the Tutorial .................................................................................................................................... i
Audience .................................................................................................................................................. i
Prerequisites ............................................................................................................................................ i
Introduction ............................................................................................................................................ 1
Introduction ............................................................................................................................................ 3
Introduction .......................................................................................................................................... 26
Introduction .......................................................................................................................................... 31
Introduction .......................................................................................................................................... 34
Introduction .......................................................................................................................................... 37
ii
C Standard Library
Introduction .......................................................................................................................................... 45
Introduction .......................................................................................................................................... 68
Introduction .......................................................................................................................................... 72
Introduction .......................................................................................................................................... 78
Introduction .......................................................................................................................................... 83
iii
C Standard Library
Introduction .......................................................................................................................................... 87
iv
C Standard Library
1. C Library ─ <assert.h>
Introduction
The assert.h header file of the C Standard Library provides a macro called assert which
can be used to verify assumptions made by the program and print a diagnostic message
if this assumption is false.
The defined macro assert refers to another macro NDEBUG which is not a part of
<assert.h>. If NDEBUG is defined as a macro name in the source file, at the point where
<assert.h> is included, the assert macro is defined as follows:
Library Macros
Following is the only function defined in the header assert.h:
This is actually a macro and not a function, which can be used to add
diagnostics in your C program.
Declaration
Following is the declaration for assert() Macro.
Parameters
expression -- This can be a variable or any C expression.
If expression evaluates to TRUE, assert() does nothing. If expression evaluates
to FALSE, assert() displays an error message on stderr (standard error stream to
display error messages and diagnostics) and aborts program execution.
Return Value
This macro does not return any value.
1
C Standard Library
Example
The following example shows the usage of assert() macro:
#include <assert.h>
#include <stdio.h>
int main()
{
int a;
char str[50];
return(0);
}
Let us compile and run the above program in the interactive mode as shown below:
2
C Standard Library
2. C Library ─ <ctype.h>
Introduction
The ctype.h header file of the C Standard Library declares several functions that are
useful for testing and mapping characters.
All the functions accepts int as a parameter, whose value must be EOF or representable
as an unsigned char.
All the functions return non-zero (true) if the argument c satisfies the condition
described, and zero (false) if not.
Library Functions
Following are the functions defined in the header ctype.h:
int isalnum(int c)
1
This function checks whether the passed character is alphanumeric.
int isalpha(int c)
2
This function checks whether the passed character is alphabetic.
int iscntrl(int c)
3
This function checks whether the passed character is control character.
int isdigit(int c)
4
This function checks whether the passed character is decimal digit.
int isgraph(int c)
5 This function checks whether the passed character has graphical representation
using locale.
int islower(int c)
6
This function checks whether the passed character is lowercase letter.
int isprint(int c)
7
This function checks whether the passed character is printable.
3
C Standard Library
int ispunct(int c)
8
This function checks whether the passed character is a punctuation character.
int isspace(int c)
9
This function checks whether the passed character is white-space.
int isupper(int c)
10
This function checks whether the passed character is an uppercase letter.
int isxdigit(int c)
11
This function checks whether the passed character is a hexadecimal digit.
int isalnum(int c)
Description
The C library function void isalnum(int c) checks if the passed character is
alphanumeric.
Declaration
Following is the declaration for isalnum() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns non-zero value if c is a digit or a letter, else it returns 0.
Example
The following example shows the usage of isalnum() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 'd';
int var2 = '2';
int var3 = '\t';
int var4 = ' ';
4
C Standard Library
if( isalnum(var1) )
{
printf("var1 = |%c| is alphanumeric\n", var1 );
}
else
{
printf("var1 = |%c| is not alphanumeric\n", var1 );
}
if( isalnum(var2) )
{
printf("var2 = |%c| is alphanumeric\n", var2 );
}
else
{
printf("var2 = |%c| is not alphanumeric\n", var2 );
}
if( isalnum(var3) )
{
printf("var3 = |%c| is alphanumeric\n", var3 );
}
else
{
printf("var3 = |%c| is not alphanumeric\n", var3 );
}
if( isalnum(var4) )
{
printf("var4 = |%c| is alphanumeric\n", var4 );
}
else
{
printf("var4 = |%c| is not alphanumeric\n", var4 );
}
return(0);
}
5
C Standard Library
Let us compile and run the above program to produce the following result:
int isalpha(int c)
Description
The C library function void isalpha(int c) checks if the passed character is alphabetic.
Declaration
Following is the declaration for isalpha() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns non-zero value if c is an alphabet, else it returns 0.
Example
The following example shows the usage of isalpha() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 'd';
int var2 = '2';
int var3 = '\t';
int var4 = ' ';
if( isalpha(var1) )
{
printf("var1 = |%c| is an alphabet\n", var1 );
}
else
{
printf("var1 = |%c| is not an alphabet\n", var1 );
6
C Standard Library
}
if( isalpha(var2) )
{
printf("var2 = |%c| is an alphabet\n", var2 );
}
else
{
printf("var2 = |%c| is not an alphabet\n", var2 );
}
if( isalpha(var3) )
{
printf("var3 = |%c| is an alphabet\n", var3 );
}
else
{
printf("var3 = |%c| is not an alphabet\n", var3 );
}
if( isalpha(var4) )
{
printf("var4 = |%c| is an alphabet\n", var4 );
}
else
{
printf("var4 = |%c| is not an alphabet\n", var4 );
}
return(0);
}
Let us compile and run the above program to produce the following result:
int iscntrl(int c)
Description
7
C Standard Library
The C library function void iscntrl(int c) checks if the passed character is a control
character.
According to standard ASCII character set, control characters are between ASCII codes
0x00 (NUL), 0x1f (US), and 0x7f (DEL). Specific compiler implementations for certain
platforms may define additional control characters in the extended character set (above
0x7f).
Declaration
Following is the declaration for iscntrl() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns non-zero value if c is a control character, else it returns 0.
Example
The following example shows the usage of iscntrl() function.
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i = 0, j = 0;
char str1[] = "all \a about \t programming";
char str2[] = "tutorials \n point";
return(0);
}
Let us compile and run the above program to produce the following result:
all tutorials
int isdigit(int c)
Description
The C library function void isdigit(int c) checks if the passed character is a decimal
digit character.
Declaration
Following is the declaration for isdigit() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns non-zero value if c is a digit, else it returns 0.
Example
The following example shows the usage of isdigit() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 'h';
int var2 = '2';
if( isdigit(var1) )
{
printf("var1 = |%c| is a digit\n", var1 );
}
else
{
printf("var1 = |%c| is not a digit\n", var1 );
9
C Standard Library
}
if( isdigit(var2) )
{
printf("var2 = |%c| is a digit\n", var2 );
}
else
{
printf("var2 = |%c| is not a digit\n", var2 );
}
return(0);
}
Let us compile and run the above program to produce the following result:
int isgraph(int c)
Description
The C library function void isgraph(int c) checks if the character has graphical
representation.
The characters with graphical representations are all those characters that can be
printed except for whitespace characters (like ' '), which is not considered as isgraph
characters.
Declaration
Following is the declaration for isgraph() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns non-zero value if c has a graphical representation as character, else
it returns 0.
Example
The following example shows the usage of isgraph() function.
#include <stdio.h>
10
C Standard Library
#include <ctype.h>
int main()
{
int var1 = '3';
int var2 = 'm';
int var3 = ' ';
if( isgraph(var1) )
{
printf("var1 = |%c| can be printed\n", var1 );
}
else
{
printf("var1 = |%c| can't be printed\n", var1 );
}
if( isgraph(var2) )
{
printf("var2 = |%c| can be printed\n", var2 );
}
else
{
printf("var2 = |%c| can't be printed\n", var2 );
}
if( isgraph(var3) )
{
printf("var3 = |%c| can be printed\n", var3 );
}
else
{
printf("var3 = |%c| can't be printed\n", var3 );
}
return(0);
}
Let us compile and run the above program to produce the following result:
int islower(int c)
Description
The C library function int islower(int c) checks whether the passed character is a
lowercase letter.
Declaration
Following is the declaration for islower() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns a non-zero value(true) if c is a lowercase alphabetic letter else,
zero (false).
Example
The following example shows the usage of islower() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 'Q';
int var2 = 'q';
int var3 = '3';
if( islower(var1) )
{
printf("var1 = |%c| is lowercase character\n", var1 );
}
else
{
printf("var1 = |%c| is not lowercase character\n", var1 );
}
if( islower(var2) )
{
12
C Standard Library
return(0);
}
Let us compile and run the above program to produce the following result:
int isprint(int c)
Description
The C library function int isprint(int c) checks whether the passed character is
printable. A printable character is a character that is not a control character.
Declaration
Following is the declaration for isprint() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns a non-zero value(true) if c is a printable character else, zero
(false).
13
C Standard Library
Example
The following example shows the usage of isprint() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 'k';
int var2 = '8';
int var3 = '\t';
int var4 = ' ';
if( isprint(var1) )
{
printf("var1 = |%c| can be printed\n", var1 );
}
else
{
printf("var1 = |%c| can't be printed\n", var1 );
}
if( isprint(var2) )
{
printf("var2 = |%c| can be printed\n", var2 );
}
else
{
printf("var2 = |%c| can't be printed\n", var2 );
}
if( isprint(var3) )
{
printf("var3 = |%c| can be printed\n", var3 );
}
else
{
printf("var3 = |%c| can't be printed\n", var3 );
}
if( isprint(var4) )
14
C Standard Library
{
printf("var4 = |%c| can be printed\n", var4 );
}
else
{
printf("var4 = |%c| can't be printed\n", var4 );
}
return(0);
}
Let us compile and run the above program to produce the following result:
int ispunct(int c)
Description
The C library function int ispunct(int c) checks whether the passed character is a
punctuation character. A punctuation character is any graphic character (as in isgraph)
that is not alphanumeric (as in isalnum).
Declaration
Following is the declaration for ispunct() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns a non-zero value(true) if c is a punctuation character else, zero
(false).
Example
The following example shows the usage of ispunct() function.
15
C Standard Library
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 't';
int var2 = '1';
int var3 = '/';
int var4 = ' ';
if( ispunct(var1) )
{
printf("var1 = |%c| is a punctuation character\n", var1 );
}
else
{
printf("var1 = |%c| is not a punctuation character\n", var1 );
}
if( ispunct(var2) )
{
printf("var2 = |%c| is a punctuation character\n", var2 );
}
else
{
printf("var2 = |%c| is not a punctuation character\n", var2 );
}
if( ispunct(var3) )
{
printf("var3 = |%c| is a punctuation character\n", var3 );
}
else
{
printf("var3 = |%c| is not a punctuation character\n", var3 );
}
if( ispunct(var4) )
{
printf("var4 = |%c| is a punctuation character\n", var4 );
}
16
C Standard Library
else
{
printf("var4 = |%c| is not a punctuation character\n", var4 );
}
return(0);
}
Let us compile and run the above program that will produce the following result:
int isspace(int c)
Description
The C library function int isspace(int c) checks whether the passed character is white-
space.
Declaration
Following is the declaration for isspace() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns a non-zero value(true) if c is a white-space character else, zero
(false).
17
C Standard Library
Example
The following example shows the usage of isspace() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 't';
int var2 = '1';
int var3 = ' ';
if( isspace(var1) )
{
printf("var1 = |%c| is a white-space character\n", var1 );
}
else
{
printf("var1 = |%c| is not a white-space character\n", var1 );
}
if( isspace(var2) )
{
printf("var2 = |%c| is a white-space character\n", var2 );
}
else
{
printf("var2 = |%c| is not a white-space character\n", var2 );
}
if( isspace(var3) )
{
printf("var3 = |%c| is a white-space character\n", var3 );
}
else
{
printf("var3 = |%c| is not a white-space character\n", var3 );
}
return(0);
18
C Standard Library
Let us compile and run the above program that will produce the following result:
int isupper(int c)
Description
The C library function int isupper(int c) checks whether the passed character is
uppercase letter.
Declaration
Following is the declaration for isupper() function.
Parameters
c -- This is the character to be checked.
Return Value
This function returns a non-zero value(true) if c is an uppercase alphabetic letter else,
zero (false).
Example
The following example shows the usage of isupper() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int var1 = 'M';
int var2 = 'm';
int var3 = '3';
if( isupper(var1) )
{
printf("var1 = |%c| is uppercase character\n", var1 );
}
else
19
C Standard Library
{
printf("var1 = |%c| is not uppercase character\n", var1 );
}
if( isupper(var2) )
{
printf("var2 = |%c| is uppercase character\n", var2 );
}
else
{
printf("var2 = |%c| is not uppercase character\n", var2 );
}
if( isupper(var3) )
{
printf("var3 = |%c| is uppercase character\n", var3 );
}
else
{
printf("var3 = |%c| is not uppercase character\n", var3 );
}
return(0);
}
Let us compile and run the above program that will produce the following result:
int isxdigit(int c)
Description
The C library function int isxdigit(int c) checks whether the passed character is a
hexadecimal digit.
Declaration
Following is the declaration for isxdigit() function.
Parameters
20
C Standard Library
Return Value
This function returns a non-zero value(true) if c is a hexadecimal digit else, zero (false).
Example
The following example shows the usage of isxdigit() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
char var1[] = "tuts";
char var2[] = "0xE";
if( isxdigit(var1[0]) )
{
printf("var1 = |%s| is hexadecimal character\n", var1 );
}
else
{
printf("var1 = |%s| is not hexadecimal character\n", var1 );
}
if( isxdigit(var2[0] ))
{
printf("var2 = |%s| is hexadecimal character\n", var2 );
}
else
{
printf("var2 = |%s| is not hexadecimal character\n", var2 );
}
return(0);
}
Let us compile and run the above program to produce the following result:
21
C Standard Library
The library also contains two conversion functions that accepts and returns an "int".
int tolower(int c)
1
This function converts uppercase letters to lowercase.
int toupper(int c)
2
This function converts lowercase letters to uppercase.
int tolower(int c)
Description
The C library function int tolower(int c) converts a given letter to lowercase.
Declaration
Following is the declaration for tolower() function.
Parameters
c -- This is the letter to be converted to lowercase.
Return Value
This function returns lowercase equivalent to c, if such value exists, else c remains
unchanged. The value is returned as an int value that can be implicitly casted to char.
Example
The following example shows the usage of tolower() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int i = 0;
char c;
char str[] = "TUTORIALS POINT";
while( str[i] )
{
putchar(tolower(str[i]));
22
C Standard Library
i++;
}
return(0);
}
Let us compile and run the above program to produce the following result:
tutorials point
int toupper(int c)
Description
The C library function int toupper(int c) converts lowercase letter to uppercase.
Declaration
Following is the declaration for toupper() function.
Parameters
c -- This is the letter to be converted to uppercase.
Return Value
This function returns uppercase equivalent to c, if such value exists, else c remains
unchanged. The value is returned as an int value that can be implicitly casted to char.
Example
The following example shows the usage of toupper() function.
#include <stdio.h>
#include <ctype.h>
int main()
{
int i = 0;
char c;
char str[] = "Tutorials Point";
while(str[i])
{
putchar (toupper(str[i]));
i++;
23
C Standard Library
return(0);
}
Let us compile and run the above program to produce the following result:
TUTORIALS POINT
Character Classes
S.N. Character Class & Description
Digits
1
This is a set of whole numbers { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }.
Hexadecimal digits
2
This is the set of - { 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f }.
Lowercase letters
3 This is a set of lowercase letters { a b c d e f g h i j k l m n o p q r s t u v w x y
z }.
Uppercase letters
4 This is a set of uppercase letters {A B C D E F G H I J K L M N O P Q R S T U V
W X Y Z }.
Letters
5
This is a set of lowercase and uppercase letters.
Alphanumeric characters
6
This is a set of Digits, Lowercase letters and Uppercase letters.
Punctuation characters
7
This is a set of ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Graphical characters
8
This is a set of Alphanumeric characters and Punctuation characters.
24
C Standard Library
Space characters
9
This is a set of tab, newline, vertical tab, form feed, carriage return, and space.
Printable characters
10 This is a set of Alphanumeric characters, Punctuation characters and Space
characters.
Control characters
11
In ASCII, these characters have octal codes 000 through 037, and 177 (DEL).
Blank characters
12
These are spaces and tabs.
Alphabetic characters
13
This is a set of Lowercase letters and Uppercase letters.
25
C Standard Library
3. C Library ─ <errno.h>
Introduction
The errno.h header file of the C Standard Library defines the integer variable errno,
which is set by system calls and some library functions in the event of an error to
indicate what went wrong. This macro expands to a modifiable lvalue of type int,
therefore it can be both read and modified by a program.
The errno is set to zero at program startup. Certain functions of the standard C library
modify its value to other than zero to signal some types of error. You can also modify its
value or reset to zero at your convenience.
The errno.h header file also defines a list of macros indicating different error codes,
which will expand to integer constant expressions with type int.
Library Macros
Following are the macros defined in the header errno.h:
This is the macro set by system calls and some library functions in the event of
an error to indicate what went wrong.
26
C Standard Library
Declaration
Following is the declaration for errno macro.
Parameters
NA
Return Value
NA
Example
The following example shows the usage of errno Macro.
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main ()
{
FILE *fp;
fp = fopen("file.txt", "r");
if( fp == NULL )
{
fprintf(stderr, "Value of errno: %d\n", errno);
fprintf(stderr, "Error opening file: %s\n", strerror(errno));
}
else
{
fclose(fp);
}
return(0);
}
27
C Standard Library
Let us compile and run the above program that will produce the following result in case
file file.txt does not exist:
Value of errno: 2
Error opening file: No such file or directory
Declaration
Following is the declaration for EDOM Macro.
Parameters
NA
Return Value
NA
Example
The following example shows the usage of EDOM Macro.
#include <stdio.h>
#include <errno.h>
#include <math.h>
int main()
{
double val;
errno = 0;
val = sqrt(-10);
if(errno == EDOM)
{
printf("Invalid value \n");
}
else
{
28
C Standard Library
printf("Valid value\n");
}
errno = 0;
val = sqrt(10);
if(errno == EDOM)
{
printf("Invalid value\n");
}
else
{
printf("Valid value\n");
}
return(0);
}
Let us compile and run the above program that will produce the following result:
Invalid value
Valid value
Declaration
Following is the declaration for ERANGE Macro.
Parameters
NA
Return Value
NA
29
C Standard Library
Example
The following example shows the usage of ERANGE Macro.
#include <stdio.h>
#include <errno.h>
#include <math.h>
int main()
{
double x;
double value;
x = 1.000000;
value = log(x);
if( errno == ERANGE )
{
printf("Log(%f) is out of range\n", x);
}
else
{
printf("Log(%f) = %f\n", x, value);
}
x = 0.000000;
value = log(x);
if( errno == ERANGE )
{
printf("Log(%f) is out of range\n" x);
}
else
{
printf("Log(%f) = %f\n", x, value);
}
return 0;
}
Let us compile and run the above program that will produce the following result:
Log(1.000000) = 1.609438
Log(0.000000) is out of range
30
C Standard Library
4. C Library ─ <float.h>
Introduction
The float.h header file of the C Standard Library contains a set of various platform-
dependent constants related to floating point values. These constants are proposed by
ANSI C. They allow making more portable programs. Before checking all the constants, it
is good to understand that floating-point number is composed of following four
elements:
S sign ( +/- )
Based on the above 4 components, a floating point will have its value as follows:
floating-point = ( S ) p x be
or
Library Macros
The following values are implementation-specific and defined with the #define directive,
but these values may not be any lower than what is given here. Note that in all instances
FLT refers to type float, DBL refers to double, and LDBL refers to long double.
Macro Description
0 - towards zero
31
C Standard Library
1 - to nearest
FLT_MANT_DIG
These macros define the number of digits in the number (in
DBL_MANT_DIG
the FLT_RADIX base).
LDBL_MANT_DIG
FLT_DIG 6
These macros define the maximum number decimal digits
DBL_DIG 10 (base-10) that can be represented without change after
rounding.
LDBL_DIG 10
FLT_MIN_EXP
These macros define the minimum negative integer value
DBL_MIN_EXP
for an exponent in base FLT_RADIX.
LDBL_MIN_EXP
FLT_MIN_10_EXP -37
These macros define the minimum negative integer value
DBL_MIN_10_EXP -37
for an exponent in base 10.
LDBL_MIN_10_EXP -37
FLT_MAX_EXP
These macros define the maximum integer value for an
DBL_MAX_EXP
exponent in base FLT_RADIX.
LDBL_MAX_EXP
FLT_MAX_10_EXP +37
These macros define the maximum integer value for an
DBL_MAX_10_EXP +37
exponent in base 10.
LDBL_MAX_10_EXP +37
FLT_MAX 1E+37
These macros define the maximum finite floating-point
DBL_MAX 1E+37
value.
LDBL_MAX 1E+37
32
C Standard Library
LDBL_EPSILON 1E-9
FLT_MIN 1E-37
LDBL_MIN 1E-37
Example
The following example shows the usage of few of the constants defined in float.h file.
#include <stdio.h>
#include <float.h>
int main()
{
printf("The maximum value of float = %.10e\n", FLT_MAX);
printf("The minimum value of float = %.10e\n", FLT_MIN);
Let us compile and run the above program that will produce the following result:
33
C Standard Library
5. C Library ─ <limits.h>
Introduction
The limits.h header determines various properties of the various variable types. The
macros defined in this header, limits the values of various variable types like char, int
and long.
These limits specify that a variable cannot store any value beyond these limits, for
example an unsigned character can store up to a maximum value of 255.
Library Macros
The following values are implementation-specific and defined with the #define directive,
but these values may not be any lower than what is given here.
34
C Standard Library
Example
The following example shows the usage of few of the constants defined in limit.h file.
#include <stdio.h>
#include <limits.h>
int main()
{
35
C Standard Library
return(0);
}
Let us compile and run the above program that will produce the following result:
36
C Standard Library
6. C Library ─ <locale.h>
Introduction
The locale.h header defines the location specific settings, such as date formats and
currency symbols. You will find several macros defined along with an important
structure struct lconv and two important functions listed below.
Library Macros
Following are the macros defined in the header and these macros will be used in two
functions listed below:
LC_ALL
1
Sets everything.
LC_COLLATE
2
Affects strcoll and strxfrm functions.
LC_CTYPE
3
Affects all character functions.
LC_MONETARY
4
Affects the monetary information provided by localeconv function.
LC_NUMERIC
5 Affects decimal-point formatting and the information provided by localeconv
function.
LC_TIME
6
Affects the strftime function.
37
C Standard Library
Library Functions
Following are the functions defined in the header locale.h:
Declaration
Following is the declaration for setlocale() function.
Parameters
category -- This is a named constant specifying the category of the functions
affected by the locale setting.
locale -- If locale is NULL or the empty string "", the locale names will be set
from the values of environment variables with the same names as the above
categories.
Return Value
A successful call to setlocale() returns an opaque string that corresponds to the locale
set. The return value is NULL if the request cannot be honored.
38
C Standard Library
Example
The following example shows the usage of setlocale() function.
#include <locale.h>
#include <stdio.h>
#include <time.h>
int main ()
{
time_t currtime;
struct tm *timer;
char buffer[80];
time( &currtime );
timer = localtime( &currtime );
return(0);
}
Let us compile and run the above program that will produce the following result:
39
C Standard Library
Declaration
Following is the declaration for localeconv() function.
Parameters
NA
Return Value
This function returns a pointer to a struct lconv for the current locale, which has the
following structure:
typedef struct {
char *decimal_point;
char *thousands_sep;
char *grouping;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
char *negative_sign;
char int_frac_digits;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_cs_precedes;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
} lconv
40
C Standard Library
Example
The following example shows the usage of localeconv() function.
#include <locale.h>
#include <stdio.h>
int main ()
{
struct lconv * lc;
setlocale(LC_MONETARY, "it_IT");
lc = localeconv();
printf("Local Currency Symbol: %s\n",lc->currency_symbol);
printf("International Currency Symbol: %s\n",lc->int_curr_symbol);
setlocale(LC_MONETARY, "en_US");
lc = localeconv();
printf("Local Currency Symbol: %s\n",lc->currency_symbol);
printf("International Currency Symbol: %s\n",lc->int_curr_symbol);
setlocale(LC_MONETARY, "en_GB");
lc = localeconv();
printf ("Local Currency Symbol: %s\n",lc->currency_symbol);
printf ("International Currency Symbol: %s\n",lc->int_curr_symbol);
printf("Decimal Point = %s\n", lc->decimal_point);
return 0;
}
Let us compile and run the above program that will produce the following result:
41
C Standard Library
Library Structure
typedef struct {
char *decimal_point;
char *thousands_sep;
char *grouping;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
char *negative_sign;
char int_frac_digits;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_cs_precedes;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
} lconv
decimal_point
1
Decimal point character used for non-monetary values.
thousands_sep
2
Thousands place separator character used for non-monetary values.
grouping
4 int_curr_symbol
42
C Standard Library
currency_symbol
5
The local symbol used for currency.
mon_decimal_point
6
The decimal point character used for monetary values.
mon_thousands_sep
7
The thousands place grouping character used for monetary values.
mon_grouping
A string whose elements defines the size of the grouping of digits in monetary
8 values. Each character represents an integer value which designates the
number of digits in the current group. A value of 0 means that the previous
value is to be used for the rest of the groups.
positive_sign
9
The character used for positive monetary values.
negative_sign
10
The character used for negative monetary values.
int_frac_digits
11 Number of digits to show after the decimal point in international monetary
values.
frac_digits
12
Number of digits to show after the decimal point in monetary values.
p_cs_precedes
p_sep_by_space
14
If equals to 1, then the currency_symbol is separated by a space from a
positive monetary value. If equals to 0, then there is no space between the
43
C Standard Library
n_cs_precedes
n_sep_by_space
p_sign_posn
17
Represents the position of the positive_sign in a positive monetary value.
n_sign_posn
18
Represents the position of the negative_sign in a negative monetary value.
Value Description
44
C Standard Library
7. C Library ─ <math.h>
Introduction
The math.h header defines various mathematical functions and one macro. All the
functions available in this library take double as an argument and return double as the
result.
Library Macros
There is only one macro defined in this library:
HUGE_VAL
This macro is used when the result of a function may not be representable as
a floating point number. If magnitude of the correct result is too large to be
represented, the function sets errno to ERANGE to indicate a range error, and
1
returns a particular, very large value named by the macro HUGE_VAL or its
negation (- HUGE_VAL).
If the magnitude of the result is too small, a value of zero is returned instead.
In this case, errno might or might not be set to ERANGE.
Library Functions
Following are the functions defined in the header math.h:
double acos(double x)
1
Returns the arc cosine of x in radians.
double asin(double x)
2
Returns the arc sine of x in radians.
double atan(double x)
3
Returns the arc tangent of x in radians.
45
Discovering Diverse Content Through
Random Scribd Documents
Eroismo di Stamura 207
Un vecchio impedisce agli
Anconitani d'arrendersi 209
Gli Anconitani mandano a
domandar soccorsi in Romagna 211
Generosità d'una dama d'Ancona 212
Un'armata romagnola ne fa
levare l'assedio 213
Federico rientra in Italia in
ottobre 215
Forza Asti a sottomettersi ivi
Intraprende l'assedio
d'Alessandria 216
Lo continua per quattro mesi
d'inverno 217
1176 La dieta de' Lombardi a Modena
leva un'armata per soccorrere
Alessandria 218
Federico, durante una tregua,
tenta sorprenderla 219
Leva l'assedio e marcia verso
Pavia ivi
L'incontrano i Lombardi e per
rispetto non lo attaccano 220
Conferenza per la pace e
sospensione d'armi 221
L'imperatore eccita sospetti nella
lega 222
1175 I legati del papa vanno a Pavia
da Federico 223
Romponsi i trattati e ricomincia la
guerra 225
Cristiano attacca i Bolognesi ivi
1176 Federico riceve il soccorso di una
nuova armata 226
Preparativi de' Milanesi per
difendersi 227
Vittoria de' Milanesi a Legnano 228
Federico abbandonato cerca di
far pace 231
Manda ambasciatori a chiederla
ad Alessandro III ivi
Il papa promette di venire al
congresso lombardo 232
L'imperatore trova partigiani tra i
Lombardi ivi
Cremona e Tortona segnano la
pace 233
1177 Il papa e gli ambasciatori di
Napoli arrivano a Venezia 235
Discussioni intorno al luogo delle
conferenze 236
Si sceglie Venezia 237
Pretensioni delle città 238
Pretensioni dell'imperatore 239
Condotta ambigua del papa 242
Propone una tregua di più anni ivi
La tregua vien segnata il 6 luglio ivi
Federico ricevuto in Venezia, e
riconciliato col papa 245
1178 Il papa tornato a Roma si
riconcilia col senato 246
1178-1183 Trattati per una pace definitiva 247
1183 Defezione di Tortona e di
Alessandria 248
Dieta a Costanza per trattare la
pace 250
Trattato di Costanza il 25 giugno
1183 251
7. Guido Grimoldi di Galavesca. Gli storici milanesi risguardano come una cosa
vergognosa per la loro patria l'avere sostenuto lo scisma, onde o non ne
fanno parola, o cercano di darne colpa ai Comaschi loro nemici; e per tal
modo resero oscura assai questa parte del loro racconto: ma ciò che non è
dubbioso, si è che Landolfo Carcano, difeso dai Milanesi, era un vescovo
scismatico eletto da Enrico V (Scheda Antiqu. ap. Jos. Mariam Stampam
præfatio ad Cumanum p. 407.); e che il poeta comasco dà ad Anselmo da
Clivio, uno degli arcivescovi di Milano, l'aggiunto di male pactus, che pare
corrispondere al vocabolo di simoniaco. Veggasi Cumanus v. 686, p. 428.; la
prefazione premessa al Poema dal Muratori p. 402, e Landolfo di s. Paolo c.
37, t. V, p. 507.
8. Landulph. Junior Hist. Mediol. c. 34, p. 504. Notæ Saxii ad eundem. —
Trist. Calcus Hist. pat. l. VII, p. 210.
9. Cum. v. 63.-114, p. 415. — Trist. Cal. Hist. Patriæ l. VII, p. 211. — Bern.
Corio Stor. Mil. p. I, p. 28.
10. Quest'isoletta, a sedici miglia al nord di Como, e cinquanta passi
solamente lontana dalla spiaggia, può avere un miglio di circuito. Ebbe un
castello assai forte fabbricato dai Lombardi.
11. Cumano v. 200.-215. Malgrado la positiva testimonianza del poeta
comasco, seguito poi da tutti gli storici lombardi, io dubito tuttavia di questa
lega fra tante città, che non avevano verun motivo di nimicizia verso i
Comaschi, ed erano anzi fra di loro rivali. Forse eransi soltanto arrolati
all'armata milanese pochi volontarj di quelle città; forse il poeta ne accrebbe il
numero per render più gloriosa la lunga resistenza e la caduta della sua
patria.
12. Piano di Como presso Alessandro Ducker. Grævius t. III, p. 1199.
13. Cumanus v. 263. Trovansene altri esempi ne' successivi anni v. 271 e 313.
14. Cum. V. 1834 e segu. p. 452. — Veggasi la nota a p. 15.
15. Lecco è posto all'estremità del Golfo a Levante, dove le acque del lago
tornano a formare l'Adda.
16. Cum. v. 1815, e segu. p. 452.
17. Cumanus v. 1900, e segu. p. 454.
18. Cum. v. 1953 p. 455.
19. Id. v. 1974 ad finem p. 455.
20. Otto Frising. de Gest. Friderici I lib. II c. 2. Rer. Ital. t. VI pag. 699. —
Mascovius Commen. de Reb. Imp. sub Conrado III lib. III p. 141.
21. Chron. Weingartense de Guelfis ap. Leibn. t. I. p. 781. Stando ad una
cronaca bavara citata da Mascovio lib. III, p. 141, tali nomi furono dati alle
parti dopo la battaglia di Winsberg tra Corrado III e Guelfo il 21 dicembre del
1140.
22. Otto Fris. in Chr. l. VII, c. 17, p. 137. — Mascov. Comment. de Reb. Imp.
sub Lothario II l. I, p. 1.
23. L'anno 1127 alla Dieta di Mersburgo. Mascov. p. 12.
24. Mascov. Comment. l. I, § 6, p. 9.
25. Otto Frising. Chron. l. VII c. 17, p. 137.
26. Landulphus Tun. l. I § 23, p. 37.
27. Mascov. Comment. l. I § 23, p. 37.
28. Otto Fris. Chron. l. VII, c. 18, p. 138.
29. Fulconis Benev. Chron. t. V, p. 115. Se crediamo a quest'autore, Lotario
non aveva con lui più di duemila soldati.
30. Stando anche alla relazione del Fleury, Stor. Eccles. lib. LXVIII, c. 1 e 2,
qualunque uomo imparziale giudicherà illegale l'elezione d'Innocente.
31. Baron. Ann. Eccl. ad ann. 1130, p. 183.
32. Ventisette contro diecinove. Tra i primi contavasi il vescovo di Porto
decano del sacro Collegio ed il più vecchio Cardinale, che godeva del favore
del popolo e della nobiltà.
33. Anonimus apud Baronium ann. 1130, § 2, t. XII, p. 184.
34. Mascovius l. II, § 7 et 9, p. 59-64.
35. Otto Fris. de Gest, Frid. I, l. II, c. 21, p. 719.
36. Gunt. in Ligur. l. III, v. 170, p. 41 apud Pitheum Scrip. Germ. Basileæ
1569.
37. Bar. ad an. 1140, § 4-19. — Fleury St. Eccl. l. LXVII.
38. Intorno ad Arnaldo da Brescia merita di esserne letta l'Apologia
pubblicatasi in Pavia l'anno 1790 in due volumi in 8.º, e dedicata al Patrizio
veneto Andrea Quirini. Oltre l'apologia trovasi nel secondo volume la di lui
vita, nella quale il dottissimo autore raccolse ed illustrò tutto ciò che intorno a
questo celebre teologo era stato scritto nel suo secolo, o nel susseguente. N.
d. T.
39. Baron. Ann. Eccl. an. 1199, § 10 et 11.
40. Sancti Bernardi Epist. 195, 196. Questo Santo così scriveva al vescovo di
Costanza: «Voi scorgerete in costui un uomo che apertamente si ribella contro
il clero, confidando nel tirannico potere della gente di spada; un uomo che
insorge contro i medesimi vescovi, ed inveisce contro tutto l'ordine
ecclesiastico. Sapendo io ciò, non saprei in tanto pericolo meglio consigliarvi e
più sanamente, che a seguire il precetto apostolico, di allontanare il male che
vi sta vicino. Un amico della Chiesa vorrebbe piuttosto che fosse legato, che
posto in fuga, onde pellegrinando di più non faccia danno ad altri. Il Papa
nostro Signore, quand'era ancora con noi, ne aveva dato l'ordine in iscritto,
dietro le informazioni avute del male che quest'uomo andava facendo; ma
sgraziatamente non trovossi alcuno che volesse fare una così buona azione.»
41. Otto Fris. in Chron. lib. VII, p. 143.
42. Si suppone che questa colonna appartenesse al tempio di Giove
conservatore. È di marmo greco d'ordine corinzio di sessantaquattro palmi
d'altezza. Vast. Itin. t. I, p. 110.
43. Otto in Frisin. Chron. l. VII, c. 31, p. 145.
44. Corrado II per l'Italia è III per la Germania.
45. Mascov. Com. de rebus Imp. sub Corrado III, l. III, pag. 114. — Otto Fris.
Chron., l. VII, c. 22, p. 140. — Id. de gestis Frid. I. l. I, c. 22, p. 656.
46. De gestis Friderici I, l. I, c. 27 et 28, p. 662.
47. Godef. Viterb. in Pant. pars XVII, t. VII. R. It. p. 461.
48. J. de Muller scrive che, stando ad una cronaca di Corbia, duemila Svizzeri
delle montagne accompagnarono Arnaldo a Roma, e lo assistettero a
ristabilirvi la libertà. B. I, c. 14, p. 410.
49. Gunt. in Ligurino, lib. III, p. 43. — Otto Fris. de gestis Frid. I, l. II, c. 21,
p. 719. — Le vite dei papi scritte da Bernardo Guidoni, e dal Cardinale di
Arragona, t. III, p. 437 439, quasi niente contengono d'importante.
50. A torto si è tentato di attribuire ad Arnaldo da Brescia opinioni troppo
libere in punto di religione e di governo. Lasciando da banda le prime perchè
affatto straniere alla presente storia, non credo inutile il dare qualche
schiarimento rispetto alle seconde, trattandosi di un uomo ch'ebbe tanta parte
ne' movimenti popolari di Roma e di Brescia; e vedremo che tutta la sua colpa
si riduce all'aver predicato contro il dominio secolare del clero. Lunga fu la
lotta che sostenne nella sua patria contro il vescovo Mainfredo, il quale faceva
ogni sforzo per rialzare in Brescia il prostrato edificio della signoria episcopale,
onde andava accarezzando i nobili, mirando a valersi delle forze loro per
distruggere i consoli, e farsi egli principe. Lo che conoscendo Arnaldo
contrario allo spirito, alle leggi ed all'utilità della Chiesa, animò i consoli ed il
popolo ad opporsi agli attentati dell'ambizioso vescovo. Colle scritture e coi
sacri canoni mostrava al popolo che i vescovi, siccome descritti in capo alla
milizia di Dio, non devono prender parte nelle faccende secolaresche; che
come successori degli apostoli debbono esserne gl'imitatori; non essendo
giusto che abbandonino la parola di Dio per occuparsi di governi temporali, di
milizie, ec. Queste spiacevoli verità annunciate da Arnaldo al popolo con
robusta eloquenza, e confermate dalla santità de' suoi costumi, riunirono
contro di lui il vescovo, tutto il clero, gli abati ed i monaci, i quali accusando
Arnaldo di eresia al concilio lateranese, ottennero, colla calunnia, di farlo
condannare. S. Bernardo chiama pessimo scisma, non eresia il titolo d'accusa
dato ad Arnaldo. E tale doveva veramente essere in faccia alla corte pontificia
la dottrina d'Arnaldo, che non solo non concedeva agli ecclesiastici la
superiorità da loro pretesa sopra il temporale dei principi, ma accordava ai
principi una piena autorità sopra i beni ecclesiastici per regolarne l'uso a
tenore dei canoni.
Obbligato di abbandonare la patria per sottrarsi alle calde persecuzioni del
clero, fu alcun tempo a Costanza, e nella Svizzera, di dove passò in Francia
per difendere il suo maestro Abaelardo accusato da s. Bernardo. Ma sul
principio del pontificato d'Eugenio III si ridusse a Roma per appoggiare colla
sua eloquenza e co' suoi consigli la fazione de' Romani, che contrastavano al
papa la temporale signoria. E forse vi fu chiamato dai Romani medesimi,
conoscendo quanto poteva esser utile al loro partito. Nè Arnaldo mancò alle
loro speranze, perchè distinguendo accuratamente le incumbenze
ecclesiastiche dalle secolari, persuase al popolo, che il Papa doveva
accontentarsi della cura spirituale di tutta la cristianità, ma non addossarsi
ancora il peso del governo temporale, la di cui alta ispezione doveva lasciare
all'imperator de' Romani suo sovrano, e l'immediata amministrazione al senato
ed al popolo romano. A tal fine confortava i Romani non solo a conservare il
senato, ma a repristinare ancora tutti gli antichi ordini e costumanze, l'ordine
equestre, i tribuni, i censori, i consoli, e l'antica forma de' giudizj e delle
milizie. N. d. T.
51. Vedasi intorno a questo regno, Mascovius Comment. de rebus Imp. sub
Corrado III lib. IV et V.
52. Otto Frisin. de Gestis Frid. I. l. II, cap. 2. Scrip. Rer. Ital. tom. VI, p. 699.
53. Ibid. — Gunteri Ligurinus lib. I, p. 12. ap. Pitheum.
54. Gunt. Ligur. lib. I, p. 6. — È anche dubbioso che vi fossero Genovesi,
perciocchè il nome di Ligures viene dato da Guntero a tutti i Lombardi.
55. Otto Frisin. Frid. I. lib. II, cap. 7, p. 703.
56. Otto Frising. I. II, cap. 7.
57. Otto Morena Hist. Land. t. VI. Rer. Ital. p. 957. — Galvan. Flamma Manip.
Flor. c. 173, t. XI, p. 634.
58. Otto Morena Rerum Laudensium p. 965.
59. Otto Morena p. 971.
60. Otto Fris. lib. II, cap. 12. 15, p. 706. — Otto Morena p. 969. — Sire Raul,
seu Radulphus Mediol. De gestis Frid. I. p. 1175, t. VI. — Ligurinus l. II, p. 24.
61. Sire Raul p. 1175.
62. De rebus gestis Frid. I. l. II, cap. 14, p. 710.
63. Otto Morena p. 973.
64. Otto Fris. de gest. Frid. I, l. II, cap. 13, e 15.
65. Ibid. Cap. 14.
66. Epist. Frid. ad Ottonem Frisin. ap. Scrip. Rer. Ital. t. VI, p. 635.
67. Tristani Calchi Hist. Patriæ, l. VIII, p. 222.
68. Otto Fris. de Gest. Frid. I. l. II, cap. 15.
69. Tutti gli storici contemporanei chiamano questa borgata Cairo, ed il
Muratori suppone che si parli d'un castello di tal nome posto alle falde delle
Alpi liguri quaranta miglia lontano da Asti. Ma ponendo mente alla strada
tenuta da Federico, non può essere che Chieri. Questa borgata, ch'egli
attraversò passando da Torino ad Asti, ebbe governo repubblicano fino alla
fine del tredicesimo secolo.
70. Otto Fris. l. II, c. 17. p. 712. — Trist. Calchi l. VIII, p. 222.
71. Tristano Calco ci diede i nomi de' capi di questi valorosi.
72. Otto Fris. de gestis Frid. I. l. II, c. 17.
73. Ibid. cap. 19.
74. Otto Morena, p. 981. — Otto Fris. l. II, c. 20 e 21, p. 718. — Abbas Usp.
in Chron., p. 283. — Godafr. Viterbiensis in Pantheo. pars XVIII, t. VII, p. 464.
— Sicardi Ep. Crem. Chron., p. 599, tom. VII Rer. Ital.
75. Otto Fris. l. II c. 21. p. 718.
76. Bar. Ann. Ecc. ad ann. 1155, §. 2, 3, e 4. Card. Aragonius in Vit. Ad. IV. p.
442. Sc. Rer. Ital T. III. P. 1.
77. Vita ad Pap. — Otto Fris. l. II, c. 21, p. 721.
78. Mur. Ant. It. Dis. IV. vol. I, p. 117.
79. Otto Fris. l. II, cap. 22.
80. Anast. Bibl. de vita Leonis IV, p. 240. Sc. Rer. It., t. III.
81. Si chiama oggi Ponte S. Angiolo, prima Pons Aelii Adriani.
82. Otto Fris. L. II, c. 23, p. 724.
83. Otto Frising. Lib. II, c. 24, p. 725. — Se l'imperatore aveva realmente
diritto di sovranità sovra di Roma, non è meraviglia che il papa facesse la
surriferita dichiarazione. N. d. T.
84. Idem. Ibid. p. 726.
85. Romualdi Salernit. Chron. p. 197. t. VII.
86. Otto Frising. l. II, cap. 25.
87. De Gestis Frid. I, l. II, c. 26.
88. Otto Mor. Hist. Ver. Land. p. 983. — Trist. Calchi Hist. Patriæ l. VIII, p.
223.
89. Sire Raul de Gest. Frid. I, p. 1176.
90. Carol. Sigon. de Regn. It. l. XII, p. 293. — Sire Raul p. 1179. — Trist.
Calch. l. VIII, p. 225.
91. Ibid.
92. Romualdi Salernit. Chronicon p. 198.
93. Willelmus Tyrius l. XVIII, c. 8. p. 937, Gesta Dei per Francos.
94. Baronius Annales an. 1166, § 1.
95. Ibid. § 4.-9.
96. Radevicus Frisingensis, Appendix ad Ottonem de rebus gestis Friderici I. l.
I, cap. 8. tom. VI. Rer. Ital. Radevico fu canonico di Frisinga che continuò
l'istoria incominciata dal suo vescovo Ottone. Noi siamo per congedarci da
costui che pure è uno de' più eleganti storici, illuminati ed imparziali de' mezzi
tempi. Ottone di Frisinga aveva sortiti illustri natali, essendo figliuolo di
Leopoldo marchese d'Austria e di Agnese sorella dell'imperatore Enrico V: era
fratello di Corrado III, re dei Romani, e zio di Federico Barbarossa. Ci
rimangono di lui due opere: una cronaca dal principio del mondo fino a' suoi
tempi pubblicata a Basilea in fog. nel 1569, da Pitteo, divisa in otto libri. Noi
abbiamo più volte citato il settimo, che contiene il secolo precedente al suo.
L'ottavo è consacrato alla storia religiosa. L'altra sua opera è ancora più
interessante, contenendo il racconto della prima discesa di Federico in Italia,
ed è divisa in due libri. Fu pubblicato nel t. VI, Rer. Ital. Ottone morì del 1158.
Benchè il suo continuatore Radevico non sia senza merito, non compensa la
perdita d'Ottone, che è quasi il solo autore che sparga qualche luce sopra un
secolo barbaro ed oscuro.
97. Otto Fris. l. II, c. 31.
98. Radevic. Fris. l. I, c. 19.
99. Radev. Frisin. l. I, c. 22.
100. Idem cap. 25.
101. Otto Morena Hist. Laud. p. 995.
102. Ibid.
103. Radev. Frigius. l. I, c. 25.
104. Tale regolamento viene riferito per intero da Radevico, lib. I, c. 26. Un
Tedesco contemporaneo, e suddito di Federico, chiamato Guntero, fece un
poema di 12 canti dei quattro libri d'Ottone di Frisinga, e del continuatore
Radevico. Gli ha quasi sempre servilmente parafrasati ne' suoi versi, che pure
sono i meno cattivi dei poeti storici di questo secolo. Egli tradusse perfino
questo regolamento, lib. VII, p. 101, ciò che forma una strana sorte di poesia.
Il suo Ligurinus si stampò in Basilea del 1569 in seguito alla storia di Ottone di
Frisinga per cura di Pitteo.
105. Otto Morena, p. 1007. — Sire Raul, p. 1180. — Radevic. Frising. l. I, c.
29. — Gunterus in Ligurino, l. VII, p. 105.
106. Otto Morena, p. 1009. — Joh. Bapt. Villanovæ, Laudis Pomp. hist. ap.
Grævium, t. III, lib. II, p. 863.
107. Radev. Frising. l. I, c. 31.
108. Idem l. I, c. 32. — Sire Raul, p. 1180.
109. Radevico dice che la città aveva cento stadj di circuito. Questa misura
greca ugualmente straniera allo storico tedesco ed agli assediati, non ci dà
che un'idea assai inesatta. Le mura presenti hanno circa sei mila tese di
lunghezza.
110. Eranvi altravolta in tutte le piazze di Roma, e probabilmente in tutte le
colonie romane, di tali portici chiamati archi di Giano, destinati a difendere i
mercanti dal sole e dalla pioggia. L'arco di Giano quadriforme nel Velabro di
Roma è il solo che siasi conservato fino ai nostri giorni. La torre posta sull'uno
e sull'altro erano opere posteriori de' tempi barbari.
111. Rad. Fris. l. I, c. 38. — Otto Morena, p. 1013.
112. Tre franchi. Le monete de' tempi d'Ottone erano state alterate assai:
Federico le ristabilì. Il suo danaro d'argento pesava un danaro ed un grano;
ma lasciò ugualmente in corso il danaro di terzuolo pesante 18 grani con un
terzo di fino e due di rame. Venti di questi grani formavano il soldo in
discorso. Devo al conte Luigi Castiglione di Milano, ed alla sua ricca collezione
di monete milanesi, tutte le mie teorie intorno alla storia monetaria di
Lombardia, che gli antiquarj hanno lasciata nella più profonda oscurità.
113. Forse alcuno l'avrà scritto, ma non so che nemmeno a que' tempi
potessero provare gli ulivi presso Milano. N. d. T.
114. Radev. Frising. L. II, c. 39.
115. Rad. Fris. t. I, c. 40 — Ligur. l. VIII, p. 114.
116. Questo trattato viene fedelmente riportato da Radevico Frisingense. L. II,
c. 41.
117. Il preambolo di questo trattato non ricorda nè l'umiliazione dei Milanesi
d'implorare perdono, nè la clemenza dell'imperatore di accordarla. Niente
ritrovasi nella sua forma che sia più duro delle condizioni. Comincia con
semplicità in tal modo. «In nomine Domini nostri Jesu Christi, haec est
conventio per quam Mediolanenses in gratiam imperatoris redituri sunt et
permansuri.»
118. Le nostre guide in questa parte di Storia fino alla conquista di Milano
sono tre scrittori contemporanei. Radevico Canonico di Frisinga di cui ho già
parlato, è il primo. Allievo di Ottone di Frisinga di cui ne continuò la storia,
adotta i suoi pregiudizj di famiglia, ed è come il maestro, appassionato
ammiratore di Federico cui dedicò la sua Storia, cercando ad ogni modo di dar
risalto alla sua gloria, a spese de' suoi nemici. Pure non era insensibile
all'entusiasmo della libertà, e siccome d'ordinario riporta estesamente gli atti
originali, la verità traspira dalla sua narrazione ancora quando non è
favorevole al suo Eroe. Il secondo è Ottone Morena: magistrato lodigiano, ed
impiegato da Federico nell'ufficio di giudice, scrisse una storia de' suoi tempi,
intitolata Historia rerum laudensium assai voluminosa, ed abbondante di
curiose particolarità, ma marcata dell'impronta di quella servilità che io
rimprovero ai legisti italiani, e piena d'invettive contro Milano. Abbiamo
finalmente uno storico milanese Sire Raul, o Rodolfo milanese, la di cui storia
di Federico I sempre abbreviatissima, e probabilmente interpolata in più
luoghi, c'istruisce assai più delle passioni de' Lombardi, che de' fatti.
Qualunque ella siasi, ci è pertanto preziosa, perchè Rodolfo è il solo scrittore
repubblicano di questo mezzo secolo, di cui siasi conservata l'opera, col di cui
sussidio si possano rettificare gli esagerati racconti degli scrittori del contrario
partito. Lessi pure, ma con pochissimo profitto, due scrittori tedeschi
contemporanei Otto de Sancto Biasio, ed Abbas Uspergensis Chronicon.
119. Rad. Fris. lib. II, c. 4. p. 786. — Gunther. Ligurinus, l. XVIII, p. 124.
120. Otto Mor., p. 1019. — Radev. Fris., l. II, c. 7.
121. Radev. Fris. l. II, c. 6.
122. Radev. Frisin. l. II, c. 7.
123. Idem, l. II, c. 9.
124. Caffari Annal. Gen. l. I, p. 270 et 271.
125. Sire Raul p. 1181, 1182. — Otto Morena p. 1021. — Radev. Frisin. l. II. c
21.
126. Radev. Fris. l. II. c. 32. — Otto Morena p. 1023. — Sire Raul p. 1182.
127. Radev. Fris. l. II, c. 18.-20, et 30, 31. — Baron. ad ann. 1159, § 1.-19.
128. Ho riportata fedelmente questa declamazione più da retore che da
storico, perchè non è in facoltà d'un traduttore di mutilare il testo. Il discreto
lettore darà quel peso che merita a quest'uscita dell'autore, non perdonabile
che in un lungo lavoro pregevole per infinite bellezze. N. d. T.
129. Radev. Fris. l. II, c. 23.
130. Sire Raul, p. 1182.
131. Radev. Fris. l. II, c. 45, p. 823.
132. Radev. Fris. l. II, c. 47. — Gunt. Lig. l. X, p. 146.
133. Otto Mor. p. 1037, 1139. — Sire Raul p. 1183. — Trist. Calchi Hist. patr. l.
II, c. 48, et 49.
134. Radev. Frising. l. II, c. 48, et 49.
135. Otto Morena p. 1046.
136. Radev. Fris. l. II, c. 59. — Otto Moren. 1045, 1047. — Guntheri Ligurinus
l. X. p. 148, 150.
137. Radev. Fris, l. II, c. 62.
138. Quantunque le repubbliche lombarde impugnassero le armi per
difendersi contro le armate imperiali, non cessarono però mai, anche in tempo
che trovaronsi vittoriose, di riconoscere le prerogative dell'Impero e di
rispettare l'imperatore, che non avrebbe facilmente trovato veruna città
ribelle, se loro avesse lasciati i privilegi accordati da Ottone il grande, e non si
fosse collegato, per opprimerne alcune, colle città rivali, le di cui milizie
sfogavano sotto il di lui nome i loro odj privati sui vinti. Del resto quante
lagrime e quanto sangue dovettero versare quelle semi-repubbliche per una
larva di libertà, ed in sostanza mancanti di vera indipendenza, di unione fra
loro e per conseguenza di quiete e di ogni civile felicità! N. d. T.
139. Barron. ad ann. 1159, § 70, et sequ. — Vita Alexan. papæ III a Card.
Arragon. t. III, Rer. Ital. p. 448.-450.
Qui incominciamo a far uso della storia di Alessandro III, scritta da un autore
contemporaneo e raccolta con alcune altre dal cardinale di Arragona. Questa
preziosa opera ci compensa di quella di Radevico che termina poco dopo
quest'epoca. Essa devesi piuttosto risguardare come la storia della guerra di
Lombardia, che come quella del pontefice. Questa storia, ordinatamente
scritta, è particolarizzata in modo che ben si conosce dettata da un testimonio
oculare; e vi si trova tutta quella imparzialità che può pretendersi da una
storia scritta in mezzo alle guerre civili. Sembra probabile che l'autore morisse
prima di papa Alessandro, poichè il racconto non arriva che fino al 1178. Le
altre due vite, quasi contemporanee, dello stesso papa raccolte da Amalrico
Augerio e da Bernardo Guidone, non meritano pure di essere ricordate.
140. L'elogio che il nostro autore fa alla vita anonima di papa Alessandro III,
non deve farci dimenticare dell'epoca in cui fu scritta, nè l'autore di essa,
quantunque assai diligente, s'innalza però sopra il livello del suo secolo. N. d.
T.
141. Otto Mor. p. 1061. — Radev. Fris. l. II, c. 75. Questa è l'ultima notizia che
prendiamo da così pregevole scrittore, il quale dettò la sua storia lo stesso
anno 1160, e la terminò allorchè furono licenziate le truppe allemanne. Alla
stessa epoca termina Guntero il suo poema; onde dei Tedeschi non ci
rimangono che Ottone da s. Biagio e l'abate Uspergense. Sussidio assai
debole.
142. Otto Morena Hist. Laud. p. 1087.
143. Otto Morena Hist. Laud. p. 1087.
144. Otto de Sancto Blasio in Chron. c. 16. Scrip. Rer. Ital. t. VI, p. 874.
145. Morena nel suo barbaro latino li chiamava blava, che è la biada
degl'Italiani, vocabolo adoperato per indicare il raccolto d'autunno e sopra
tutto la biada di Turchia e la sagina, che io credo non ancora coltivata in Italia
nel dodicesimo secolo. Si potrebbe per altro risguardare questo passo come
una prova del contrario.
146. Anticamente il nome generico di biava usavasi in Lombardia per indicare
qualunque specie di granaglie, ma il grano turco s'incominciò a coltivare alcuni
secoli dopo l'epoca di Federico Barbarossa. N. d. T.
147. Sire Raul p. 1186.
148. Otto Morena p. 1099. È vero che l'imperatore lasciava in loro arbitrio di
arrendersi a discrezione o sotto così dure condizioni, che i suoi medesimi
cortigiani non credevano eseguibili; e perciò s'applicarono al primo partito.
Burchardi Ep. de Excid. Med. t. VI, Rer. Ital. p. 915.
149. Otto Mor. p. 1103, 1105. — Sire Raul p. 1187. — Otto de Sancto Blasio c.
16, p. 875. — Trist. Calchi Hist. patr. l. X, p. 253. — Galv. Flamma Manip. Flor.
c. 189, p. 642. — Veggasi sopra tutto, Epist. Burchardi Notarii Imp. ad Nicol.
Sigebergensem abbatem t. VI, Rer. Ital. p. 915.-918. Abbiamo in questa
lettera un assai circostanziato racconto della ruina di Milano e dell'impressione
che fece sui Tedeschi la vittoria dell'imperatore.
150. Queste sono piuttosto crudeltà dei tempi che di Federico, cui il nostro
autore rende più sotto la debita giustizia, dicendo che se incrudelì nel caldo
della guerra, mostrossi poi umano coi nemici sottomessi, non infierendo che
contro le insensibili mura. Nè ai Milanesi doveva riuscire inaspettato l'ordine di
atterrare la loro città, dopo ch'essi avevano usato lo stesso trattamento ai
Lodigiani. N. d. T.
151. Otto Mor. p. 1105, 1107. — Trist. Calc. Hist. Patr. l. X, p. 256. — Joh.
Bapt. Villan. Hist. Laud. Pomp. l. II, p. 875.
152. Sire Raul p. 1188. — Galv. Flam. Manip. Flor. c. 192. p. 644. — Bern.
Corio Stor. Milanesi p. I, p. 54.
153. Caffari Ann. Genuenses l. I, p. 271.
154. Idem. p. 278.
155. Questo trattato viene riportato per intero dal Muratori. Antiqu. Ital. Diss.
XLVIII. t. IV, p. 253.
156. Caffari Ann. Gen. p. 280.-283. — Breviarium Pisanæ Hist. p. 173.-174. —
Uber. Fol. Gen. Hist. l. II, p. 268. — Marang. Cronache di Pisa. Scrip. Etr. t. I,
p. 387.
157. Obertus Cancel. Ann. Gen. l. II. p. 292.
158. Obertus Cancel. Ann. Genuens. p. 293, 294. — Breviar. Pisanæ Hist. p.
175, 176. — B. Marangoni Cron. di Pisa p. 394.
159. Obert. Can. p. 295.-298. — B. Maran. Cron. di Pisa p. 398.
160. Obertus Canc. p. 310.
161. Obertus Canc. Ann. Genuens. p. 324-327. Uberti Foliettæ Genuensis Hist.
l. II, p. 278.
162. Otto Mor. Hist. Laud. p. 1123.
163. Id. Ibid. p. 1127-1129. Non sappiamo per altro se Otto Morena sia
sempre l'autore di questa parte della storia, o se abbia a quest'epoca
incominciato la continuazione scritta da suo figliuolo Acerbo. La narrazione dal
padre viene senza interrompimento continuata dal figliuolo e da uno
sconosciuto, senza che possa sapersi ove termina l'uno, ed incomincia l'altro.
Acerbo Morena militò sotto l'imperatore, e morì nella spedizione di Roma
l'anno 1167. Acerbo manifesta sentimenti più generosi e più liberali del padre.
164. Sire Raul p. 1189.
165. Vita Alex. III a Card. Arragonio p. 456 — Se può darsi fede allo storico
greco Cinnamo (L. V, c. 13. p. 103. Bisan. t. XI), quest'alleanza fu conchiusa
ad istigazione dell'imperatore Manuele Comneno geloso del crescente potere
di Federico. Egli contestavagli il titolo d'imperatore, e mandò Niceforo Calufi a
Venezia, ed altri agenti di minor conto nelle altre città con ragguardevoli
somme di danaro per eccitare alle armi i Lombardi in difesa della loro libertà.
166. Acerbus Morena p. 1123.
167. Vita Alex. III. a Card. Arrag. p. 456.
168. Otto de Sancto Blasio Chron. c. 18. et 19. t. VI. Rer. It. p. 875 — Conradi
ab. Usper. Chron. p. 293. apud Pithaeum.
169. Vita Alex. III. a Card. Arrag. p. 456.
170. Ibid. p. 457. — Romuald. Saler. Chron. p. 205.
171. Guglielmo I, coronato ancora vivente il padre l'anno 1150, morì del 1166.
Romual. Saler. p. 205. Questo storico che dopo la congiura di Matteo Bonella
fu il principale liberatore del re, fu pure uno de' principali suoi ministri, uno dei
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com