couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Morandini <lmorand...@ieee.org>
Subject Re: Fixed precision of floating point number not respected in views
Date Wed, 20 Feb 2013 05:39:59 GMT
On 02/20/2013 03:10 PM, svilen wrote:
> well then avoid floating point as representation.
> it is not keeping the input 100%, by design - no matter what language.
> Either use text - "1.1" - or fake-fixed-point via integer -
> e.g. "1100" for 3 digits after point.
> or both, i.e. keep the textual input separately from machine
> representation.

As I -repeatedly- have written, our system shall accept a number of different data 
models, models that cannot be known in advance, hence both suggestions are very 
difficult to implement, not to mention the performance penalty involved.

Transforming every number in a string would entail putting a "flag" on every 
number, to tell which one was a genuine number. Something like:
[1.1, 2.2, 3.3, "abc"] ==> [{"_": "1.1"}, {{"_": "2.2"}, {{"_": "3.3"}, "abc"]

This "flag" would make possible the conversion back to numbers.

Regards,

Luca Morandini
Data Architect - AURIN project
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini


Mime
View raw message