[PATCH weston v2 12/21] Introduce a 'double fixed' data type abstraction

Bill Spitzak spitzak at gmail.com
Fri Jun 12 09:52:31 PDT 2015


On Thu, Jun 11, 2015 at 3:40 PM, Peter Hutterer <peter.hutterer at who-t.net>
wrote:

> On Thu, Jun 11, 2015 at 02:37:38PM -0700, Bill Spitzak wrote:
> > Do you actually need 64 bits or are you just trying to get more than 8
> bits
> > of fraction?
> >
> > If instead other fixed types were provided, such as 1.30 or 7.24, etc
> could
> > that be used? This could be covered by the existing fixed type by just
> > defining the argument as being the desired value multiplied by some power
> > of 2.
>
> any 32-bit fixed point will hit the limits in one way our another, so
> you're
> just messing up the space. it's easier to have two data types where one
> will
> definitely be enough.
>

Well so will 32.32 fixed-point, it is pretty easy to get out of that range
as well. The question is if the api actually needs more than 32 bits of
*precision*.

I think avoiding IEEE floating point in the api is a mistake actually. You
are basically adding more types instead of the exponent. And you are going
to have to be able to transmit infinity and NaN lossless eventually and
will end up inventing your own floating point format.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150612/e1704dd5/attachment.html>


More information about the wayland-devel mailing list