Currently the code generator (CgExpr.hs) downcasts integers as C would, but downcasts complex numbers with truncation (using functions from numerics.c). At the same time the static evaluator (Interpreter.hs) downcasts everything using C-style casts. We should instead be using truncating downcasts consistently everywhere (according to @bradunov) and perhaps have a flag for instead using C-style downcasts.
Currently the code generator (CgExpr.hs) downcasts integers as C would, but downcasts complex numbers with truncation (using functions from numerics.c). At the same time the static evaluator (Interpreter.hs) downcasts everything using C-style casts. We should instead be using truncating downcasts consistently everywhere (according to @bradunov) and perhaps have a flag for instead using C-style downcasts.