support for long numbers
Nicolas Goutte
nicolasg at snafu.de
Wed Oct 6 01:26:21 BST 2004
>List: kde-core-devel
>Subject: Re: support for long numbers
> From: Diego Iastrubni <elcuco () kdemail ! net>
>Date: 2004-10-06 0:11:29
>Message-ID: <200410060211.29578.elcuco () kdemail ! net>
>
>
>áéåí øáéòé, 6 áàå÷èåáø 2004, 01:56, ðëúá òì éãé Nicolas Goutte:
>> No, KSpread is not related to KCalc, not even KSpread's calculator is KCalc
>> (even if it is discussed to change that for ages.)
>I read that you were implmenting some dcop information interchange between
>kcalc and kspread... buh... too much beer...
Well, there was a new discussion about using KCalc as KSpread's calculator
instead of the one of KSpread. But that is just the calculator, not KSpread's
interna.
(...)
>> >>The numbers also sypport a "display". The idea is that each number can be
>> >>displayed on screen in many ways... for example in Roman numerals, Indic,
>> >>Hewrew... etc.. I have implemented Roman, Armenic, Hebrew, and
>> >> Indic/Arabic (which means every ther script based on 10 digits is damm
>> >> easy to implement, just derive as new class).
>>
>> If you mean non-European digits, there is a start of support in Qt 3.3's
>> QLocale, which is supposed to be improved in Qt4. (For KSpread, bug
>> #79862.)
>oh.,, buah... I have been looking at that code in Qt. It sucks. Really, it's
>completele ugly, and definetly not OOP.
>
>It can only handle numerals in pure decimal, while hebrew for example, is not
>exactly deciamal. Please also note that you cannot use QLocale to get numbers
>in Roman. BTW, this is why I wrote this class to begin with. (I asked Lars in
>aKademy about it, and he told me the code in Qt only changed digits, too gay
>for me).
Ah, well, good to know the critic.
So there is not much to await from it. :-(
>> >This lib has no way of representing numbers in different ways (like mine
>> >does), and does not support munbers in different bases.
>>
>> GMP has the advantage to have a rather complete mathematical library and
>> also that somebody external is managing it. (I do not think that we have
>> many mathematicians for KDE.)
>I was thinking of adding GMP as another backend to my class. This has the
>advantage, that if GMP is not found, you still have basic functions
>available.
Interesting idea. It would avoid that GMP would be mandatory (because I am
rather sure that some distributions do not really want to ship a
scientific-oriented library.)
>> As for bases, at least some functions of GMP can use a different base, like
>> mpz_set_str and mpz_get_str
>> (Of course, that is only for integers, but it is only there were bases are
>> useful.)
>says who?
> 0xFF.8+01 = 256.5 <- (hex+octal=decimal)
>It's not used, but it it's valid math.
I have not said that it does not exist. But its use is much reduced compared
to integer with non-decimal bases.
>> Have a nice day!
>you meant night :)
(...)
More information about the kde-core-devel
mailing list