Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
104 views

Sympy has (at least?) three types of infinity (infinity, negative infinity, and complex infinity). I have come across the problem of testing if a sympy expression is infinite and my program failed ...
C Olsson's user avatar
4 votes
1 answer
153 views

I couldn't find documentation for this behaviour and it looks like a bug ([Edit] it is indeed : gitlab.haskell.org/ghc/ghc/-/issues/10387). Am I missing something ? In GHCi : > import GHC.Real ...
141592653's user avatar
  • 804
0 votes
1 answer
63 views

I have this code: import java.util.List; import java.util.Scanner; public class AddElementsInLists { private static final Object lock1 = new Object(); private static final Object lock2 = new ...
Матвей Шавлов's user avatar
2 votes
3 answers
124 views

1.000000000000001 ** float('inf') == float('inf') while 1.0000000000000001 ** float('inf') == 1.0 What determines the exact threshold here? It seems to be an issue of float precision, where numbers ...
Elan SK's user avatar
  • 139
1 vote
1 answer
118 views

I need to make an endless running line with gradient text that changes as it moves, as in the example, it works, but there are problems in Safari, everything twitches there and the letters seem to run ...
Clop1986's user avatar
0 votes
1 answer
107 views

We are trying to convert the delta into adx in which we have delta column double type and data in it is "1.7976931348623157E308" which is double max value, and using copy activity we need to ...
Sachin's user avatar
  • 15
0 votes
1 answer
1k views

How to allow all hosts for infinity datasource in grafana. my json for config map of datasource is kubectl describe configmap grafana-app-config-datasource -n grafana Name: grafana-app-config-...
M.K.S's user avatar
  • 99
1 vote
1 answer
170 views

PostgreSQL range docs suggest that the magic timestamp infinity should work the same as omitting the bounding value: Element types that have the notion of “infinity” can use them as explicit bound ...
Jan Klan's user avatar
  • 1,034
2 votes
1 answer
168 views

My input x is a [1,256,60,120] shaped tensor. My Conv2d is defined as follows import torch.nn as nn conv2d = nn.Conv2d( 256, 256, kernel_size=2, stride=...
Liubove's user avatar
  • 85
-1 votes
1 answer
111 views

#include <math.h> void main() { double a = 0; a += 5e308; a -= 3.5e308; if (a == INFINITY) { printf("1 %e\n", a); } else printf("0 %e\...
Hari Haran's user avatar
2 votes
1 answer
163 views

This question is inspired by this question about negative infinity and this other question about the total ordering of floating point numbers. It is motivated by my impression that, given some ...
Spencer's user avatar
  • 2,274
5 votes
1 answer
182 views

In Python 3.10.9, this example raises OverflowError: complex exponentiation: complex("inf") ** 1 But this works, evaluating to (nan+nanj): complex("inf") ** 2 Why does it work ...
Petr's user avatar
  • 71
4 votes
1 answer
7k views

I want to express floating-point infinity in C++ for my program. I came across two ways to achieve this: using INFINITY and std::numeric_limits<float>::infinity(). Both options seem to work, but ...
user avatar
0 votes
0 answers
120 views

I am trying to convert floating point values to their string representation, using the QString class from the Qt framework. To do this, I am using the following function: QString QString::arg(double a)...
HarryP2023's user avatar
2 votes
1 answer
4k views

I'm working on implementing a logo slider in my React application using CSS. I want the slider to behave as an infinite loop, where the last logo in the slide is followed by the first logo, and this ...
Amir Ben Shimol's user avatar
0 votes
0 answers
532 views

I am trying to plot my data using scatterplotMatrix, to draw scatter plots depend on different ID. Yet I got an error: seq.default(min(x), max(x), length = evaluation) : 'from' must be a finite ...
Bing Xie's user avatar
5 votes
3 answers
26k views

Am using Nuxt-3 as my framework for the project and am very new to the framework too and when I was integrating api for my project and I was getting the response later when I tried to use api as ...
user20663233's user avatar
2 votes
0 answers
105 views

I have this simple program: test.cc: #include <limits> #include <iostream> #include <cmath> int main() { std::cout << (std::isinf(std::numeric_limits<long double>::...
Piotr Siupa's user avatar
  • 5,275
1 vote
1 answer
164 views

Is there any difference between the infinities returned by the math module and cmath module? Does the complex infinity have an imaginary component of 0?
Alec's user avatar
  • 9,803
0 votes
2 answers
92 views

as you can see this is the code for an unbeatable AI TicTacToe game(game.py is the main file): game.py import math import random class Player(): def __init__(self, letter): self.letter = ...
kheder47's user avatar
0 votes
1 answer
244 views

I am getting wrong results resolving below task: Generalized harmonic numbers. Write a program GeneralizedHarmonic.java that takes two integer command-line arguments n and r and uses a for loop to ...
lklk's user avatar
  • 13
6 votes
2 answers
196 views

In experimenting with rounding modes, FE_DOWNWARD ( and FE_TOWARDZERO) apparently fails to form the expected sum of infinity and instead forms DBL_MAX when adding DBL_MAX and 1 ULP of DBL_MAX. Follows ...
chux's user avatar
  • 159k
3 votes
2 answers
1k views

Consider the following C++ code: #include <fenv.h> #include <iostream> using namespace std; int main(){ fesetround(FE_TONEAREST); double a = 0x1.efc7f0001p+376; double b = -...
Heygard Flisch's user avatar
0 votes
1 answer
611 views

I have been struggling to create a automatic speech recognition neural network using tensorflow trained on the hugging face mozilla common voice 11 dataset. The model seems to train well for around ...
Nathan Montanez's user avatar
1 vote
1 answer
106 views

An alternative title to this question is: When is an NA date not an NA? Answer: when it is infinity formatted as a date. Converting infinity to a date results in NA being displayed, but it is not! >...
Rainfall.NZ's user avatar
1 vote
1 answer
433 views

I have a variable in C which can contain the values HUGE_VAL or -HUGE_VAL. I can see there exists a function called isfinite() complying with C99, which is the standard I use. But according to the man ...
jgpallero's user avatar
  • 223
56 votes
3 answers
4k views

I've been finding a strange behaviour of log functions in C++ and numpy about the behaviour of log function handling complex infinite numbers. Specifically, log(inf + inf * 1j) equals (inf + 0.785398j)...
Firman's user avatar
  • 948
1 vote
2 answers
419 views

python -c "import numpy as np; print(np.sum([-np.Inf, +np.Inf]))" gives numpy\core\fromnumeric.py:86: RuntimeWarning: invalid value encountered in reduce return ufunc.reduce(obj, axis, ...
bers's user avatar
  • 6,371
0 votes
2 answers
94 views

The deviations of the mean should always sum up to 0. However, when the mean has a lot of digits, maybe infinitely like this one which is 20/7, R fails to calculate it. x <- c(1,2,2,3,3,4,5) sum(x -...
uke's user avatar
  • 874
1 vote
0 answers
698 views

If I compile my program with -Ofast with clang, sometimes I will get an infinite float back, but isinf() and isfinite() don't work. U is a floating-point type, I (>=0) and wbits (>0) are ...
user1095108's user avatar
  • 14.8k
1 vote
0 answers
226 views

with sympy I solved an equation for a parameter (x1 in this case) and then substituted another parameter c2 by 0 (in the real solution). import sympy as sp c1, c2, x1, F_C = sp.symbols("c1, c2, ...
phrt's user avatar
  • 11
2 votes
1 answer
630 views

Suppose I have a vector S and am interested in computing the value ln(1+exp(S)) or ln(1+exp(-S)). However, if an entry is too large or too small, I will encounter Inf problems or other numerical ...
Kilkik's user avatar
  • 181
-1 votes
1 answer
728 views

I'm trying to make a simple BMI calculator. However, if I just hit the calculate button, after the alert it renders the NAN as a 'result'. And if I just input the weight, it returns an Infinity ...
Rafael Lopes's user avatar
1 vote
1 answer
102 views

Having this issue most likely I am doing everything wrong, but I wanted to find the smallest and the biggest number inside an array and return it to a new object, and if this array is empty I wanted ...
Vincenzo Chiovaro's user avatar
0 votes
1 answer
125 views

I am trying to calculate valocity in Python with for loop. But when I run my code, I get "-inf" as a result for every row. This is my code: Vx = 0 for i in range(1, len(x_axis.timestamp)): ...
Eva's user avatar
  • 19
0 votes
2 answers
271 views

I wrote a fortran program to code this algorithm (https://en.wikipedia.org/wiki/Reservoir_sampling#Algorithm_A-ExpJ). It works on my computer. But after I asked these two questions (Intrinsic Rand, ...
Stef1611's user avatar
  • 2,609
0 votes
0 answers
86 views

In this simple calculus, all the results are OK : program main real :: x,y,z x=0.0 y=1/x; print *,y y=log(x); print *,y z=0.99; y=z**(1/x); print *,y z=1.0; y=z**(1/x); ...
Stef1611's user avatar
  • 2,609
3 votes
2 answers
1k views

I have stumbled upon a seemingly simple problem which I just cannot solve. I am attempting to use max and which on a vector that does not contain the value of interest. Ideally I would like to ...
Mark Miller's user avatar
  • 13.2k
0 votes
2 answers
4k views

I've got some code I'm using to do comparisons, and I want to start with infinite values. Here's a snippet of my code. import ( "fmt" "math" ) func snippet(arr []int) { ...
rusted_ruby's user avatar
4 votes
3 answers
2k views

How do I subset rows from a data frame which have at least one infinite value (Inf or -Inf)? Here is an example data frame: my_data <- data.frame(column1 = c(Inf, 5, 3,4,5), ...
juliefoxsteven's user avatar
1 vote
1 answer
338 views

I've run into this problem (infinite singular values despite finite entries in an array) several times for relatively small arrays with dimensions around 100 by 100. The arrays are large enough that I'...
user196574's user avatar
2 votes
0 answers
137 views

numpy's floor division seems counterintuitive when dealing with np.inf. I feel like the answer should be same as true division in these examples >>> -7 // np.inf -1.0 >>> -7 / np....
pierce314159's user avatar
0 votes
1 answer
126 views

I'm trying to train a neural network with keras and tesorflow. As usual, I replace -np.inf and np.inf values with np.nan to later run a dropna sequence and clear all that wrong data such as: Data....
Aurepilous's user avatar
1 vote
1 answer
145 views

If I try to use calculations with infinity results (in float32 representation) there are some unexpected results, as if the calculations were in double precision. Simple casts to shortreal doesn't ...
Mogwaika's user avatar
0 votes
0 answers
36 views

public static int sod2(int x) { if(x<10) return 0; return sod2(x/10)*10 + (x%10); } } I can not understand how its not infinity recursive, tried some different numbers and ...
Botboy's user avatar
  • 1
2 votes
2 answers
2k views

I am trying to collect data from REST API using Grafana plug-ins (Infinity, Simple JSON, JSON), The problem is in order to access the API you should maintain a valid OAuth Token which expires every ...
Hamzeh Abu Ajamieh's user avatar
1 vote
1 answer
382 views

I am working on a problem in Ruby. The function called last_digit takes in two integers. The first integer is then raised to the power of the second integer. The function must return the last digit of ...
Machiavellie's user avatar
0 votes
0 answers
138 views

I created a component to calculate the power of numbers but the problem is Number.MAX_SAFE_INTEGER. how can I calculate a larger number like 5^200 in my app completely without rounding? Math.pow(5,200)...
hossein fti's user avatar
  • 1,830
1 vote
0 answers
61 views

Hello I am a beginner in unity 3D and I want to create a game where a ball rolls on the ground and you need to doge the obstacles but I don't know how to create the ground generate infinity and I also ...
staynoobs's user avatar
3 votes
2 answers
1k views

I have a SQLite database with a table named measurements, which contains some experimental data measured by a power meter. They're stored as data type REAL in a field named power_dbm. In some ...
比尔盖子's user avatar
  • 3,737

1
2 3 4 5
10