연산자 (프로그래밍): 두 판 사이의 차이

내용 삭제됨 내용 추가됨
16번째 줄:
몇몇의 프로그래밍 언어에서 연산자는 아마도 자료의 한 종류보다 많은 정의를 가지고 있는 ''애드혹 다형성''일 것이다, ([[자바 (프로그래밍 언어)|자바]]에서 같은 <tt>+</tt> 연산자는 숫자의 덧셈과 문자열의 연결 모두에 사용된다). 이러한 연산자는 ''오버로드된 것''으로 전해지고 있다. 프로그래밍 언어에서 프로그래머가 연산자의 제한된 집합을 가진 연산자 오버로딩을 지원하지만, 연산자 오버로딩은 종종 연산자에 맞게 정의하는 데 사용한다.
 
== Operand피연산자 coercion강제 변환 ==
{{see참고|Type타입 conversion변환}}
Some languages also allow for the operands of an operator to be implicitly converted, or [[Type_conversion#Implicit_type_conversion|''coerced'']], to suitable data types for the operation to occur. For example, in [[Perl]] coercion rules lead into <code>12 + "3.14"</code> producing the result of <code>15.14</code>. The text <code>"3.14"</code> is converted to the number 3.14 before addition can take place. Further, <code>12</code> is an integer and <code>3.14</code> is either a floating or fixed-point number (a number that has a decimal place in it) so the integer is then converted to a floating point or fixed-point number respectively.