c - What does "type domain" and "real type" mean? -


quoted n1570:

6.3.1.8 usual arithmetic conversions

1 many operators expect operands of arithmetic type cause conversions , yield result types in similar way. purpose determine common real type operands , result. specified operands, each operand converted, without change of type domain, type corresponding real type common real type. unless explicitly stated otherwise, common real type corresponding real type of result, type domain type domain of operands if same, , complex otherwise. pattern called usual arithmetic conversions:

  • first, if corresponding real type of either operand long double, other operand converted, without change of type domain, type corresponding real type long double.
  • otherwise, ......

what "type domain" , "real type"? i've search document, no definition found.

6.2.5 types of n1570 says following:

integer , floating types collectively called arithmetic types. each arithmetic type belongs 1 type domain: real type domain comprises real types, complex type domain comprises complex types.

then further:

there 3 real floating types , designated float , double , , long double. 42) set of values of type float subset of set of values of type double ; set of values of type double subset of set of values of type long double

and

there 3 complex types, designated float _complex , double _complex, , long double _complex.

(do note standard not complex integer types, integer types defined in standard belong real type domain).

thus clear domain refers mathematical concepts of real numbers ℝ , complex numbers ℂ.


basically excerpt in question says if example add real number imaginary number or complex number, result complex number; , operands promoted width of largest operand before operation.


Comments