How do you define INFINITE? As far as I know, there is no discrete value for INFINITE, so you are going to have to create your own definition and then use it.
If you are using a number datatype, every system will have a limit which is dependent upon how many bits it can handle at a time, so true INFINITY is impossible.
What is it you are really trying to do? Perhaps somebody can provide you with a workable solution.
The magnitude limit of PLS_INTEGER and BINARY_INTEGER in PL/SQL is -2147483647 .. 2147483647 "Helping others to help themselves..."
=================================
Thomas V. Flaherty Jr.
Birch Hill Technology Group, Inc.
Right, you need to define exactly what you are trying to do. Just assigning max values to a column won't actually make the value behave like infinity. Some things work, but others don't. For example
infinity > number
2147483647 > number
This probably works, because you most likely won't need to store 2147483647 as a real value.
On the other hand
infinity - number = infinity
2147483647 - number = number
That doesn't work at all, so you have to be careful not to perform arithmetic on "infinite" values.
And just to round out the pantheon of numbers,
floating point goes from 1E-130 to 10E125 (which, while not really close to infinity, will get you a long way towards it!).
I don't know, Carp. The largest known prime number is around 10E4000000. I would be a lot more impressed if Oracle provided a datatype large enough to store it.
Me too. And I'd be REALLY impressed if they could do infinity!! However, even Oracle's documentation indicates that they are limited by your hardware, so your results may vary.
HI all,
I am doing bunch of calculation within my procedure.
Now the values can be all over the place.
Example
lat = 97.12456
long = 29.12345
va1 = 2.000245654
infinite_val := 1000000000;
What is a good datatype I could use for all these possibilities. Right now I'm using float datatype.But the outcome is not what I expect. Any thoughts will help! I need to perform arithmatic funtion on a infinite. How can I do this?
Please take the time to explain why you need to perform arithmetic on infinity. Infinity isn't a number, so operations defined on real numbers aren't defined on a set that includes infinity.
It's hard to avoid the impression that you are modeling your work incorrectly. I don't see the justification of inventing a whole new arithmetic that allows operations on infinity. Even less do I see how to do this in a database implementation where you are limited by the physical limitations of storage.
Of course, adding n+1 an infinite number of times won't get you to NULL. But then again, I don't think it would work for INFINITY either.
If you are doing arithmetic, then some kind of number is a good choice. If integers won't work, then by all means a floating point number is the way to go.
For about the fourth time in this thread, what -exactly - are you trying to do?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.