Home » U++ Library support » U++ Core » Value: why not float support?
Re: Value: why not float support? [message #30318 is a reply to message #30315] |
Fri, 24 December 2010 13:55   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
i admit i have no idea about sql layer in Upp, havent needed it so far. so i dont really understand how this would break it..maybe you can explain it in some 2 phrases..
the new Null value is imho not really a problem.
well, my problem, like described above, is, that i use the cool upp types, which can be packed into Value, as direct feed to the OSC layer, which basicly supports the intrinsic types, but this depends on the spec version, 1.0, or additinoally, 1.1.
1.0 supports int, float, string and blob (binary).
1.1 *additionally* supports int64, double, bool, datetime, etc..
so i decided to simply use the Value as container type, also because there are many implicit conversion possibilities, which spare a lot of work. thats why the extension is crucial, for me at least 
i was going well with the 'float as double' handling, as long as keeping spec 1.0 support only, but when, cleanly, extending to 1.1, i need both types to be distinct.
that'd be no problem, i could define and use a custom RichValue<float> and use it just like that, but the conversion mechanisms cant be enriched with user code to support it. IsNumber(), and the implicit converters.
if that'd were possible, no hassle.
but nevertheless, float beeing intrinsic type was finally a motivation to extend it.
i have to admit, char, unsigned types and all that aren't there as well, but they are at least, binary compatible types, means
a char could be banary transported as int, and be interpreted as is later. this holds true for unsigned types as well. but float and double, when transported / serialized over net etc. are *not* binary compatible. though they might be treated equal in cpu, on the net and serialsation, they arent. float is 4 byte, double is 8. this is another pro for float.
if i understood what else might brick with it, i could help thinking of a solution. but i'd rather prefer to make sql layer aware of float than to spare out on float (IMO ofcorse)
afaik, sql also supports both (and some more)
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview .html
so let me know, where i can help, if so.
EDIT:
i figured out, that all major database concepts (mysql, postgre sql, oracle, mssql) support float (or single precision).
the only exception is sqlite3, which only supports double, but one could fix this very fast i think, mapping float to double there.
[Updated on: Fri, 24 December 2010 14:53] Report message to a moderator
|
|
|
 |
|
Value: why not float support?
By: kohait00 on Mon, 30 August 2010 10:54
|
 |
|
Re: Value: why not float support?
By: mirek on Tue, 31 August 2010 15:49
|
 |
|
Re: Value: why not float support?
By: kohait00 on Tue, 31 August 2010 16:11
|
 |
|
Re: Value: why not float support?
By: mirek on Tue, 31 August 2010 18:49
|
 |
|
Re: Value: why not float support?
By: kohait00 on Tue, 31 August 2010 22:02
|
 |
|
Re: Value: why not float support?
By: gprentice on Wed, 01 September 2010 13:52
|
 |
|
Re: Value: why not float support?
By: kohait00 on Wed, 01 September 2010 16:13
|
 |
|
Re: Value: why not float support?
By: mirek on Thu, 02 September 2010 09:40
|
 |
|
Re: Value: why not float support?
By: kohait00 on Thu, 02 September 2010 11:24
|
 |
|
Re: Value: why not float support?
By: mirek on Mon, 06 September 2010 10:40
|
 |
|
Re: Value: why not float support?
By: kohait00 on Mon, 06 September 2010 11:54
|
 |
|
Re: Value: why not float support?
By: kohait00 on Mon, 13 December 2010 15:47
|
 |
|
Re: Value: why not float support?
By: mirek on Wed, 15 December 2010 16:15
|
 |
|
Re: Value: why not float support?
By: kohait00 on Wed, 15 December 2010 16:41
|
 |
|
Re: Value: why not float support?
By: rylek on Mon, 20 December 2010 23:08
|
 |
|
Re: Value: why not float support?
By: kohait00 on Tue, 21 December 2010 08:20
|
 |
|
Re: Value: why not float support?
By: mirek on Fri, 24 December 2010 12:39
|
 |
|
Re: Value: why not float support?
By: kohait00 on Fri, 24 December 2010 13:55
|
 |
|
Re: Value: why not float support?
By: mirek on Sat, 25 December 2010 10:48
|
 |
|
Re: Value: why not float support?
By: kohait00 on Sun, 26 December 2010 11:28
|
 |
|
Re: Value: why not float support?
By: mirek on Mon, 27 December 2010 13:20
|
 |
|
Re: Value: why not float support?
By: kohait00 on Mon, 27 December 2010 14:28
|
 |
|
Re: Value: why not float support?
By: mirek on Mon, 27 December 2010 14:44
|
 |
|
Re: Value: why not float support?
By: kohait00 on Tue, 28 December 2010 13:47
|
 |
|
Re: Value: why not float support?
By: kohait00 on Mon, 07 March 2011 14:31
|
 |
|
Re: Value: why not float support?
By: mirek on Mon, 07 March 2011 23:04
|
 |
|
Re: Value: why not float support?
By: kohait00 on Tue, 08 March 2011 08:33
|
Goto Forum:
Current Time: Tue Jul 01 11:06:42 CEST 2025
Total time taken to generate the page: 0.03625 seconds
|