This chapter delves into the details of C's numerical data types and arithmetic operators. We begin with the rules for composing identifiers and then move on to the various integer and real data types. We show how to create numerical constants and declare numerical variables and how to read and print these values. Along the way we study the range of values each type can hold, and when each type is most appropriate. After looking at the numerical data types, we introduce C's arithmetic operators and examine conversions between different data types. The chapter concludes with a case study that converts decimal numbers to other bases.
Jump to: [Previous Chapter | Next Chapter]
Math ���� standard library functions
1. �Ǽ� x�� ���� n�� �Է¹� x�� n�� ���� print�ϴ� program�� �ۼ��϶�.
Function prototype: double power(double x, int n);
(n�� ������ �� ���� ����)
2. 10���� x�� ������ n������ ��ȯ�ϴ� ���α��� �ۼ��϶�. (convert.c�� convfnc.c ����)
3. ������ �Է¹� �� ���� sin, cos, tan ������ ����ϴ� ���α��� �ۼ��϶�.
sin, cos, tan �Լ��� �Ķ���ͷ� ����(radian) ���� ����Ѵ�. ���� ���� "math.h"��
M_PI�� #define �Ǿ� �ִ�.
radian = angle * M_PI / 180.0
���� ���:
Coefficients (a, b, c)�� �Է��Ͻÿ�? 1.0 2.0 1.0 ���������� 1.0*x*x + 2.0*x + 1.0 = 0�� ���� �߱�: -1.0