Implement the "unum" representation in D ?

jerro jkrempus at gmail.com
Thu Feb 20 15:41:11 PST 2014


> We might not need random access though.

Even if you don't need random access, you can't
store them in a packed way if you want to be able
to mutate them in place, since mathematical operations
on them can change the number of bits they take.

> Depends on the application.

I suspect that in most numerical applications
the number of bits needed to store the numbers
will keep increasing during the computation until
it reaches the maximal supported value. That can
actually happen very fast - a single division
with a non power of two is enough. Applications
that could actually benefit from this in any way
are probably extremely rare. The only one I can
think of is to use it as a very simple form of
compression, but I'm sure there are better options
for that.


More information about the Digitalmars-d mailing list