support for long numbers
Diego Iastrubni
elcuco at kdemail.net
Mon Oct 4 15:31:33 BST 2004
Hi,
I have written a set of classes which can handle very large numbers. The
numbers can be as big as 100! (159 digits) and fibonacci number 7! (1452
digits).
The class can handle numbers in any base (by default it's 10, you you can
assign it "normal" numbers as well). It can perform calculations on those
numbers, for example 0xFF * 0x12 will be calculated in hexa (without moving
to decimal first). This is critical for very large numbers.
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).
You can start counting from 1 to 1000, and evey number that has 7, or devides
by 7, we change display, a nice fun game :)
Does KDE need such beast? If it does, I will try to finish some thigns (for
example rewrite the division code, and implement display->qnumber, and
changing bases for numbers?).
--
diego, kde-il translation team, http://www.kde.org/il
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
More information about the kde-core-devel
mailing list