double.ToString(): Completed in ms: 41
double.ToString('r') completed in ms: 65
DoubleConverter.ToExactString(): Completed in ms: 1733
BitConverter.ToString() completed in ms: 46
double.ToString('G') completed in ms: 40
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
Speaking about your question:
> > BTW how does your Arbitrary decimal class convert to/from a double?
I'm not sure about what you meant. But it is not a new class. It
existed before (DoubleConverter used it to store decimal
representation of double) I've just refactored it a bit to reduce
byte[] arrays allocation. It was used to conver big ot very small
doubles to string but not vice versa. Even after my refactoring I'm
sure it is slow enough so I would prefer ToString("r"). However
ToString("g") should be also enough in most cases.
I hope that ToString("g") will be enough for most cases so we may
forgot about DoubleConverter. At least let's check if someone report
any issues related to this topic on a new version the Redis client.
If any of the authors of other Redis clients (including ones written
for languages other than .Net) are here I just wonder how do you
conver doubles to bytes before sending to Redis? Did you face any
issue with parsing doubles to different values on Redis side?
On 1 ноя, 08:39, Demis Bellot <demis.bel...@gmail.com> wrote:
> Hi Mikhail,
>
> The latest version of the Redis client now has 'long' score overloads for
> Sorted Set operations that had previously only had double scores:
> Latest version is on NuGet or can be downloaded from:https://github.com/ServiceStack/ServiceStack.Redis/downloads
>
> Cheers,
>
> On Mon, Oct 31, 2011 at 11:56 AM, Demis Bellot <demis.bel...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi Mikhail,
> > Thx for this class although just this weekend I've already pushed a
> > version of the Redis client (v2.28) that just uses
> > double.ToString("G", CultureInfo.InvariantCulture); since it's
> > comparatively quick and is the same method that Booksleve uses (the other
> > popular Redis Client).
>
> > As expected that does result in a tiny loss of fraction. I'll have a look
> > at this class and check to see if it's a better fit.
> > BTW how does your Arbitrary decimal class convert to/from a double?
>
> > I also agree that it makes sense to have a int/long score, so I'll look at
> > adding these overloads as well.
>
> > Thanks,
> > Demis
>
> > On Mon, Oct 31, 2011 at 10:52 AM, Mikhail Mikheev <michail_mikh...@mail.ru
> ...
>
> продолжение »
value.ToString("G", CultureInfo.InvariantCulture);
Expected: 1.2345678901234567E+19d
But was: 1.23456789012346E+19d
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.