Anthony Borla wrote:
> So are you saying that integer arithmetic is arbitrary precision-based, and
> floats are hardware-mapped ?
Yes, that is how they are implemented right now. We use GNU's multiple
precision library for integers only. But Mozart's floats may change in
the future...
However, I am not sure that 'type promotion' will ever happen in Oz.
First, type promotion heavily relies on static type analysis, and Oz has
dynamic types. Second, variables cannot change value. Therefore, if X
is an integer and X=Y, Y must be an integer. So type promotion should
be made explicit by the programmer :p
Well, "type promotion" for purposes of arithmetic operators could simply mean converting an int-type to a float-type for purposes of the operation, as in
fun {Number.'+' A B}
case {IsFloat A}#{IsFloat B} of true#true then
A*B
[] false#false then A*B
[] false#true then {IntToFloat A}*B
[] true#false then A*{IntToFloat B} end
end
Max Wilson
--
Be pretty if you are,
Be witty if you can,
But be cheerful if it kills you.
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
