Hello people, im basically looking for a method to create a class called "real_no" which has the capacity to store numbers as they are.
i.e if the input is given as 2 + Root(2) then i should be able to store it as 2 + Root(2) and not 3.414. also, i would like it to be a structure where it is possible to carry the operations of + - * / with relative ease. with 2+ Root(2) the problem is pretty simple. but what of a number like
Root(2+root(109^{2/3})) here the problem starts getting a bit complex.
also,
[U]Root(2+root(109^{2/3}))[/U]
23 + 55^{2/3}
also what if there is a root inside a root inside a root etc. like Root(3 - Root(4 + Root(5)))
so basically im looking for a storge and retrieval structure which will enable me to operate such data.
if not then can anyone suggest a method by which recursive data storage can be acheived ion C++? i.e supposing I create a class of type A then i would like to store an object or a pointer or something to another object of type A as a data member of class A.
THANKS IN ADVANCE!!!