Home » U++ Library support » U++ Core » Value: why not float support?
Re: Value: why not float support? [message #30336 is a reply to message #30318] |
Sat, 25 December 2010 10:48 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
kohait00 wrote on Fri, 24 December 2010 07:55 |
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.
|
AFAIK, there is little difference in promoting char to int and casting back and doing the same with float and double.
Quote: |
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.
|
Sure, and every single SQL engine accepts double there (then perhaps casting it to float internally).
Anyway, that is not a problem. The issue is that existing code, which includes SQL/U++ connectors (there is about 5 of them), does not expect to get something like V_FLOAT as Value.
Currently, any float gets promoted to 'double', so it is send as double and everything works. Make Value to remember that such a type is 'V_FLOAT' and you are sudenly missing appropriate case in switch....
Which is quite easy to fix in connectors and in 'uppsrc', actually, but IMO it is little demanding to expect every U++ users to scan through his code for similar cases.
To do that, I would need some solid reason...
And you still have not provided any clue how do you plan to use this (A bit of end-user code would really be helpful). If you need to support 'char' in your interface, I do not see a single reason why you could not support 'float' the very same way.
Mirek
|
|
|
|
|
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: Fri Nov 01 01:38:02 CET 2024
Total time taken to generate the page: 0.02181 seconds
|