Conceptually I think it should work - the same PN counter design could
handle floats as well as integers.  You'd have to make sure the P and N
values only grew by handling the sign - if you want to add a negative float
you would do N += abs(V). There are also concerns around error bounds and
all those kinds of things you deal with in floats.  I'll risk stating the
obvious and say you could do fixed point stuff with the existing counters
if you multiply / divide by a scale factor on store/retrieval



On Wed, Oct 7, 2015 at 7:40 AM Emyr James <e...@sanger.ac.uk> wrote:

> Hi,
> This is more of a question for developing riak as opposed to using it,
> anyway I thought it worth asking.
> You have the "Counter" convergent datatype which allows increment and
> decrement of arbitrary integer values.
> Would it be possible to implement an "Accumulator" datatype which would
> be a floating-point equivalent of counter and allow increment and
> decrement by arbitrary floating point values ?
> Regards,
> Emyr
>
>
> --
>  The Wellcome Trust Sanger Institute is operated by Genome Research
>  Limited, a charity registered in England with number 1021457 and a
>  company registered in England with number 2742969, whose registered
>  office is 215 Euston Road, London, NW1 2BE.
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to