If I understand you correctly, your problem boils down to the fact that you
want a way to enter Float32 literals.

Note that if x and y are both Float32s, z = x + y is a Float32 as well.
Therefore, the challenge is just in ensuring everything is a Float32 at the
get-go.  You can use Float32 syntax to do this:

julia> typeof(1.0f0)
Float32

This is a Float32 literal, documented here
<http://julia.readthedocs.org/en/latest/manual/integers-and-floating-point-numbers/#floating-point-numbers>,
and hinted at by Julia when it prints Float32s:

julia> float32(2.5)
2.5f0

Once you ensure all inputs to your algorithms Float32s, you should be able
to do what you want without overriding the default Float or anything so
drastic.

-E

Reply via email to