Re: [AD] C++ fix math

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> What?  Excuse me?  What compiler is this?  That makes no sense.  Why
> would it be doing that?  cos doesn't even TAKE a fix value.  Why would
> the compiler convert the value to fix and convert it back to float?

Because Allegro overloads cos() for its fix class.

> I think that we shouldn't make it explicit.

The 'explicit' keyword was precisely devised to solve this problem.

> It would break backwards compatability, and I'm not sure that that's the
> problem.

Not much (and that's allowed for the 4.1.x series). Moreover, the trend in
modern C++ is to make everything over-explicit (static_cast,
reinterpret_cast, const_cast, dynamic_cast). So I'm ok to require an
explicit cast for our fix class.

- Eric



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/