Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Value: why not float support?
Re: Value: why not float support? [message #30402 is a reply to message #30392] Tue, 28 December 2010 13:47 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
naah...that was not what i meant Smile
anyway, permit another question..

why does Value support int? int64 would do it just the same?
why bool? it's actually an int or even int64 for the cpu / compiler.

so breaking this down, the only meaningfull types would be double and int64, as representing the superset of possible types. which i suppose would be the perfect case.. but in terms of handling it'd be a nightmare, a lot of (int)myval, (bool)myval or myval = (double)myfloat and (int64)myint. why not have Value do all this mess?

if the user decides to represent it's data as double, or as float, or int or int64 he also decides on the resolution he needs, well knowing that this might 'implicitly' reduce some resolution, if coming from double precision i.e..

sorry to bother you with all that. i clearly can understand that you are not well with the thought of extending / breaking a working code just for the benefit of some marginal usecases. i'd do the same. mi point is, that i see a lot more potential in usage of Value than is currently possible. this is genious class that eases handling with types a LOT. but it needs some leverage of burdens.

just to demonstrate: i had to program a typed interface for a gui in our enterprise, and, just because i was 'scared' of Value, knowing it was not able to easy deal with float (because this is what our communication protocol uses the most) left it out to be used. instead, i took a templated approach, inveneted a custom database for objects, etc. etc.. now looking back, having better understood Value and having float support, i'd save me a LOOOT af work and headache.

generally, i'd recommend to enrich Value to support all types which differ in sizeof(), these are the signed variants.. this makes Value really attractive in usage in communication protocols.

bool
char
short
int
int64
float
double
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Core/Path.cpp: the limitation of GetCurrentDirectory for POSIX
Next Topic: InitCaps() proposal
Goto Forum:
  


Current Time: Tue Aug 26 00:14:28 CEST 2025

Total time taken to generate the page: 0.06906 seconds