[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: KSpread 2.0: some issues
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2006-12-23 10:17:38
Message-ID: 200612231117.42249.stefan.nikolaus () kdemail ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday, December 23, 2006 10:45:16 AM Tomas Mecir wrote:
> Float class would be unnecessary, because we already have the Value
> class which can do these things for us.

The Value class holds data of different kinds: integers, floats, booleans, 
strings, arrays. The Float class should just handle the floating point 
numbers.

> Furthermore, falling back to 
> double is not an option, because the current setup already does allow
> automated conversion, things like 5+"3" work thanks to the use of
> ValueCalc. It simply is doing more than just allow support for GMP.
>
> Overloading operators within Value or Float or whatever is
> unfortunately not an option, although I was considering it. The
> problem is that we are doing locale-specific conversions, and these
> are not possible, as you cannot pass the locale object with the
> overloaded operator call. We simply have to use the ValueCalc object,
> which has the locale information.

The conversions could be done on construction of the Float object. Or, if it 
is really necessary in an operation, it could hold a static locale object 
(pointer).
But then, if we typedef the Float class to double, we're in trouble. ;) No 
automatic type conversions anymore.
Deriving from double is not possible AFAIK. But one could encapsulate the 
double in Float and rely on inlined operators, which simply fall back to 
double's operators.

Regards,
Stefan

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic