Talk:Arithmetic/Complex: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 4:
:I did some looking; there are complex built-in types in the C99 standard, with defined implicit casts up and down to the other numeric primitives. --[[User:IanOsgood|IanOsgood]] 10:36, 11 March 2008 (MDT)
::How could an implicit cast from a complex type to a floating point or integer type result in a valid value? Simple integers and floats cannot represent both the real and imaginary parts of the complex number.--[[User:Waldorf|Waldorf]] 17:36, 11 March 2008 (MDT)
:::The codeSame exampleway only(int)1.5 usesisn't conversionsvalid. from realA typesdown-cast towould complexstrip types;the butimaginary complexpart. typesImplicit canup-casts beare convertedthe tothe realmore typesuseful bycase discardinganyway, theallowing imaginaryscalar/complex partarithmetic. --[[User:Spoon!IanOsgood|Spoon!IanOsgood]] 1810:2157, 1112 March 2008 (MDT)
Anonymous user