Big Decimal

已查看 166 次
跳至第一个未读帖子

christkv

未读,
2011年6月29日 10:18:142011/6/29
收件人 BSON
Hi

I'm the maintainer of the mongodb driver for node.js and I'm getting
some requests around representation of values.

Right now there is a 32 bit integer, 64 bit integer and a 64 bit float
type for bson. However some people are trying to store larger numbers
(I expect scientific or something similar) that have a need for a
larger resolution than 64bits. I'm thinking maybe a big decimal or big
integer type would be useful but I might be completely off my rocker
in this case ?

Right now I'm just telling people to store their big decimals in a
serialized form as a string.

Gergely Nagy

未读,
2011年6月29日 10:39:062011/6/29
收件人 bs...@googlegroups.com
> Right now there is a 32 bit integer, 64 bit integer and a 64 bit float
> type for bson. However some people are trying to store larger numbers
> (I expect scientific or something similar) that have a need for a
> larger resolution than 64bits. I'm thinking maybe a big decimal or big
> integer type would be useful but I might be completely off my rocker
> in this case ?
>
> Right now I'm just telling people to store their big decimals in a
> serialized form as a string.

The binary type would be more appropriate, in my opinion.

--
|8]

christkv

未读,
2011年6月29日 10:44:552011/6/29
收件人 BSON
Hi Gergely

Yeah that's true. It would be nice to have a native type though or a
binary subtype that would allow for mapping to some sort of correct
type for calculations on mongodb or on the client side of a driver.
For now I guess I can just tell people to pick their own subtype
number and assign it to BCD for their apps.

On Jun 29, 4:39 pm, Gergely Nagy <alger...@madhouse-project.org>
wrote:

Scott Hernandez

未读,
2011年6月29日 10:45:292011/6/29
收件人 bs...@googlegroups.com
Yes, you can can store it as a binary but without a fixed scale it is
hard to search on; but just for storage it will be just fine.

christkv

未读,
2011年6月29日 11:16:022011/6/29
收件人 BSON
Hi Scott

Do you think it would make sense long term to define a type (or
subtype for binary) for scientific calculations so mongo would be able
to perform calculations? For node there would definitively need to be
a c++ driven extension to make it fast as the current implementations
are pretty slow.

Cheers

Christian

Scott Hernandez

未读,
2011年6月29日 11:20:342011/6/29
收件人 bs...@googlegroups.com
If you want the server to do smart things then yes, but currently
there are no plans to add variable size/scale ints or fp types.

If you read through the archives you will find previous discussions about this.

christkv

未读,
2011年6月29日 11:53:462011/6/29
收件人 BSON
Roger :). Now at least I know how to respond to people asking :)

On Jun 29, 5:20 pm, Scott Hernandez <scotthernan...@gmail.com> wrote:
> If you want the server to do smart things then yes, but currently
> there are no plans to add variable size/scaleintsor fp types.
回复全部
回复作者
转发
0 个新帖子