support for long numbers

Diego Iastrubni elcuco at
Wed Oct 6 01:11:29 BST 2004

ביום רביעי, 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...

> In KSpread, there was the idea to use GMP. However it is not possible
> currently and it is not priority goal either. (It is part of bug #52359)
ok, whatever :)

> >>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).

> >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 

> 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.

> Have a nice day!
you meant night :)

diego, kde-il translation team, 

Please avoid sending me Word or PowerPoint attachments.

More information about the kde-core-devel mailing list