Questions tagged [infinity]

Infinity is a specific floating point value that is always larger than any other floating point value. It may arise as a result of division by zero, arithmetic overflow and other exceptional operations. Infinity is different from the maximal still valid floating point value that the certain data type can hold. IEEE 754 floating point standard allows both positive and negative infinity values.

Infinity is a specific floating point value that is always larger than any other floating point value. It may arise as a result of division by zero, arithmetic overflow and other exceptional operations. IEEE 754 floating point standard allows both positive and negative infinity values.

Infinity is different from the maximal still valid floating point value that the certain data type can hold. This value is still smaller than the infinity.

Some programming languages allow to specify the infinity in the code explicitly. For instance, the Java code

    double [] values = ...
    double min = Double.POSITIVE_INFINITY;

    for (double x: values) 
      if (x < min) min = x;

can be used to obtain the minimal value in the array that only contains usual, valid floating point values.

475 questions
0
votes
2 answers

C++ NTL (by Victor Shoup): How to represent infinity

I would like to know how would one represent infinity if there is no built-in function for you to do so. I know that if we are using float or double, we will be able to use infinity() with #include . But if I need to use int or in the case…
BlackAdder
  • 127
  • 8
0
votes
2 answers

JS: displaying an infinitely long coordinating system (grid)

I would like to display an infinitely long coordinating system/grid (X and Y axes), which contains an endless amount of square (something like DIVs), using JavaScript. I don't have any idea where to start. It seems to me like a really hard problem…
T.Lange
  • 576
  • 1
  • 4
  • 16
0
votes
0 answers

Dealing with infinities in scientific programming

I want to calculate the entropy of a time series, but I found that in the way, there are some infinities arising from a log(0). In this particular case, those zeros represent a frequency with amplitude zero. That's just a bit of context. What I…
r_31415
  • 8,752
  • 17
  • 74
  • 121
0
votes
1 answer

jQuery Infinite Scroll with Masonry

I'm using Masonry and Infinite Scroll but the code below doesn't work ! Is that I forgot something in my HTML ? All items are displayed at once !
Chris
  • 435
  • 1
  • 8
  • 21
0
votes
1 answer

Extrude shadow volumes to infinity

I want to use the depth-fail algorithm to make shadow volumes and all works great, but i can't figure out how to extrude the shadow volume quads to infinity. The aim is to create the shadow volume for a triangle that is lit up from a point light. I…
0
votes
0 answers

Using MATLAB calculating infinite integration

I work with symbolic toolbox, and here is my code: syms x h g=(1-x).*(1-x+h); int(g,-inf,inf) and the result is : ans = piecewise([h in R_, Inf], [0 < sign(Im(h)) and h in R_, Inf + i*Inf], [sign(Im(h)) < 0 and h in R_, Inf - i*Inf]) the answer I…
Heinz
  • 2,415
  • 6
  • 26
  • 34
0
votes
1 answer

Check items in multidimensionaly array in Python

I have a dynamic multidimensional array, that can have a different number of columns each time. The user is asked to select which columns to extract from a file with N-columns, and based on this number, a multidimensional array 'ARRAY_VALUES' is…
Victor
  • 1,014
  • 1
  • 9
  • 11
0
votes
1 answer

implementation of isnan() function

I am a beginner to c++ programming and I am given a task of implementation of fixed point math arithmetic in c++. here I am trying to implementation a function isnan() which returns true if the number is not-a-number else will return false. Test…
Dr7
  • 15
  • 3
0
votes
1 answer

multiplying large matrix elements results in infinite

I am supposed to combine all the matrix into one, which concatenate horizontally by matrix = [matrix1 matrix2 matrix3]; now i have to find the mean of the matrix which is 32 x 2039 dimensions. i tried looping through each row and using mean for the…
Seif Sharif
  • 103
  • 1
  • 2
  • 10
0
votes
1 answer

PHP check infinity inside switch

The following code: switch ($value) { case INF: $x = 'INF'; break; case -INF: $x = '-INF'; break; case NAN: $x = 'NaN'; break; default: break; } doesn't work as I expected. I know that there are functions…
ducin
  • 25,621
  • 41
  • 157
  • 256
0
votes
2 answers

FLASH_MODE_TORCH working/not working

I wanted to build a flashlight app using the following code. It's working on a friend's HTC Desire HD, but it isn't on my RAZR and a friend's Galaxy Nexus. I also tried the solution with focus_mode_infinity, but there's still no success. package…
0
votes
3 answers

Javascript Infinity Object

I'm caclulating the mean value of a function's request/sec, appearently the result number sometimes is too long so it displays as Infinity, is there a way to round it so it show a number only? Or make a sleep()/wait() while it's on Infinity? well to…
nihulus
  • 1,475
  • 4
  • 24
  • 46
0
votes
1 answer

Intersection of a line with the infinity plane

I would like to compute the intersection of a 3D line with the plane at infinity. I suspect it would be the same as taking the 3D direction of the line and setting the 4th vector coordinate to 0. However, this is not enough. I would like to know the…
Violin Yanev
  • 1,507
  • 2
  • 16
  • 23
0
votes
3 answers

Attempting to find closest number in array results in -Infinity JavaScript

I am trying to find the number that is the closest to another (the user's browser height) in an array and h is randomly -Infinity. Here is my code. function match_height() { var heights = [11, 630, 693, 756, 819, 882, 945, 1008, 1071, 1134,…
flowers
  • 163
  • 1
  • 1
  • 9
0
votes
0 answers

How to use infinities with BC Math in php?

I cannot find how to use infinities with BC Math. Let's take something like: $result = echo bcdiv("1", $divider); It goes all well until $divider is 0. So you make an exception: if (!bccomp($divider, "0")) { $result = echo bcdiv("1",…