473,738 Members | 9,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extensions to my BigInteger and BigRational classes

Hello:

I am currently working on a some simple (not really) classes called
BigInteger and BigRational. They are pretty much identical to Java's
BigInteger and BigDecimal classes, respectfully.

BigRational is really simple and it just maintains a dividend and
denominator and then prints out the decimal form when done with the
calculation.

However, I want to have something that can handle irrationals also.
Without them, I can't perform powers to decimals; i.e., 2^(1/2). This
is kind of inhibiting. That also means I can't do some trig functions
also.

Would it be possible for me to maintain the denominator and dividend
as pairs of (BigInteger, BigRational)? It would allow me to represent
what I am asking for, but how would I actually get a value out of it;
i.e., x^(1/2) + x^(1/5) = ???.

Is there some where I can learn how to represent irrationals and still
maintain arbitrary precision numbers? or am I asking for something
impossible?

Thanks,
Travis
Nov 16 '07 #1
2 2781
You need to limit the scope of what you are trying to do. Otherwise,
you will need to implement a full symbolic algebra system (like Maple or
Mathematica) and use combining/simplifying/factoring/equation solving logic
to handle the most general cases.

You could limit yourself to dealing with square roots and perhaps other
irrationals. Then you could look into "continued fraction arithmetic". Do
a Google search on that for some ideas.

But take warning by looking at
http://www.math.utexas.edu/pipermail...07/005351.html
<je**********@g mail.comwrote in message
news:b6******** *************** ***********@i29 g2000prf.google groups.com...
Hello:

I am currently working on a some simple (not really) classes called
BigInteger and BigRational. They are pretty much identical to Java's
BigInteger and BigDecimal classes, respectfully.

BigRational is really simple and it just maintains a dividend and
denominator and then prints out the decimal form when done with the
calculation.

However, I want to have something that can handle irrationals also.
Without them, I can't perform powers to decimals; i.e., 2^(1/2). This
is kind of inhibiting. That also means I can't do some trig functions
also.

Would it be possible for me to maintain the denominator and dividend
as pairs of (BigInteger, BigRational)? It would allow me to represent
what I am asking for, but how would I actually get a value out of it;
i.e., x^(1/2) + x^(1/5) = ???.

Is there some where I can learn how to represent irrationals and still
maintain arbitrary precision numbers? or am I asking for something
impossible?

Thanks,
Travis

Nov 16 '07 #2
On Nov 16, 2:54 pm, "Fred Mellender" <nospamPlease_f red...@gmail.co m>
wrote:
You need to limit the scope of what you are trying to do. Otherwise,
you will need to implement a full symbolic algebra system (like Maple or
Mathematica) and use combining/simplifying/factoring/equation solving logic
to handle the most general cases.

You could limit yourself to dealing with square roots and perhaps other
irrationals. Then you could look into "continued fraction arithmetic". Do
a Google search on that for some ideas.

But take warning by looking athttp://www.math.utexas .edu/pipermail/maxima/2007/005351.html

<jehugalea...@g mail.comwrote in message

news:b6******** *************** ***********@i29 g2000prf.google groups.com...
Hello:
I am currently working on a some simple (not really) classes called
BigInteger and BigRational. They are pretty much identical to Java's
BigInteger and BigDecimal classes, respectfully.
BigRational is really simple and it just maintains a dividend and
denominator and then prints out the decimal form when done with the
calculation.
However, I want to have something that can handle irrationals also.
Without them, I can't perform powers to decimals; i.e., 2^(1/2). This
is kind of inhibiting. That also means I can't do some trig functions
also.
Would it be possible for me to maintain the denominator and dividend
as pairs of (BigInteger, BigRational)? It would allow me to represent
what I am asking for, but how would I actually get a value out of it;
i.e., x^(1/2) + x^(1/5) = ???.
Is there some where I can learn how to represent irrationals and still
maintain arbitrary precision numbers? or am I asking for something
impossible?
Thanks,
Travis- Hide quoted text -

- Show quoted text -
That's what I was afraid of. Thank you!
Nov 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
12982
by: Jerry | last post by:
Hi, I am writing a Java Chatroom application that will implement encryption of messages using the RSA algorithm using the BigInteger class. It uses socket connections to exchange messages. I have managed to generated the Private and Public keys and exchanged public keys and modulus between the clients and server. Please could someone advise me how encrypt a short message, pass the encrypted message across a socket connection and then...
4
2109
by: christopher diggins | last post by:
A feature that I find signficantly missing in C# is the ability to write functions in interfaces that can call other functions of the interface. Given an interface ISomeInteface the only way we can write a general purpose function to operate on all objects which implement that interface is through the following style of declaration (in the following code snippets i is an interface variable of type ISomeInterface) : SomeStaticClass {...
4
1451
by: Lee Forst | last post by:
What is all required to run an ASP.NET application on an IIS server? Of course you would need to have the .NET Framework installed, but do you have to have the ASP.NET Extensions installed? What do the extensions give you. Thanks
10
2537
by: musosdev | last post by:
Hi guys I'm trying to migrate to VS2005... I've managed to do that, but realised I'd opened my web projects as file projects, and I'm getting the error about network BIOS command limit. Anyway, I decided to have a go at loading them as web projects from our Win2k3 server. It gets so far and then says "The web server does not appear to have FrontPage server extensions installed".
1
2207
by: James Maeding | last post by:
I was looking for the easiest way to add an item to explorer's right click menus, and I found what looks to be a goldmine. There is a vb.net project available on: http://www.mvps.org/emorcillo/en/code/shell/shellextensions.shtml that encapsulates the ugly stuff and gives an easy way to make the dll explorer will look for as the extension handler. Only problem is, I don't see how it "runs". All the other progs to do shell extensions are...
19
6465
by: shana07 | last post by:
I don't understand about this program is doing. Could someone please tell me what it is about. Because I have gcd function in one program that calls this function. Thanks a lot switch (opcode) { case GCD: out = b1.gcd(b2).toString(); break; /** * Returns a BigInteger whose value is the greatest common divisor of * <tt>abs(this)</tt> and <tt>abs(val)</tt>. Returns 0 if * <tt>this==0 &amp;&amp;...
2
2849
by: gemacjr1201 | last post by:
I am creating a GUI for class and need help with my program. My program takes 2 big integers and adds them together. First how do I declare my 2 Big Integers and then add them together? I have read the API docs , but still need help. Thanks! import java.math.BigInteger; public class Integer { private BigInteger IntegerONE; // both entered as strings from GUI private BigInteger IntegerTWO; public Integer() {
6
13573
by: mearvk | last post by:
Does C++ or C have something roughly equivalent to this: http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html What I need is a way to quickly convert between decimal and binary and from char*/string to a numeric representation. Thanks!
11
10513
by: imranisb | last post by:
Hi, Im developing RSA cryptography based application in VC#.Net 2.0 and need to use "BigInteger.probablePrime()". I know that VC#.Net 2.0 doesn't have the BigInteger class but found that one buddy created BigInteger class but it is missing some overloading function like BigInteger.probablePrime(). The code of the BigInteger class developed in the C#.Net can be found here: http://www.codeproject.com/KB/cs/biginteger.aspx
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.