3,198 questions
3
votes
2
answers
187
views
How to compare the numerical precision of two different tensors
I'm trying to compare the output of two tensors with different numerical precisions: one in float64 (fp64) and the other in float32 (fp32). Both tensors are computed from the same inputs and represent ...
0
votes
2
answers
140
views
.NET MAUI Numeric Entry accept dot and comma as decimal separator
Is there a way to accept dot and comma as a decimal separator in an numeric entry field?
From the keyboad it is not allowed to enter a dot in a german enviorment.
<Entry Text="{Binding LVK}&...
1
vote
1
answer
61
views
Reducing to Hessenberg form using Givens rotations
I'm trying to implement a function in Python that reduces a square matrix to upper Hessenberg form using Givens rotations. I know that this should be possible Wiki and sometimes preferred over ...
4
votes
1
answer
143
views
In Haskell, why toRational (1/0) == infinity is False?
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
...
0
votes
0
answers
98
views
Apache Calcite with PostgreSQL: “DECIMAL precision 0 must be between 1 and 19” Exception
I am using Apache Calcite 1.38.0 along with the PostgreSQL JDBC driver version 42.7.2. When executing an SQL query through a JdbcSchema connection to my PostgreSQL database, I encountered an exception....
0
votes
0
answers
50
views
Jacobi method converges faster than Gauss-Seidel in case of Laplace equation
It is need to solve the problem using the Jacobi method: d^T/dx^2 + d^2T/dy^2 = 0 with conditions at the boundaries of the square:
T(0, y) = 1, T(x, 1) = 1, dT/dx(1, y) = 1 - y, dT/dy(x, 0) = x.
...
0
votes
0
answers
35
views
Adding a NumericUpDown to a menu?
Windows Forms has a control NumericUpDown that allows the user to choose a number by clicking tiny up and down arrows, or entering a number via keys.
Is there a way to add this functionality, but ...
0
votes
0
answers
38
views
Partial derivative of logistic function for Levenberg-Marquardt
I am trying to write code that will fit logistic function to set of data. I am using Levenberg-Marquardt routine (as given in Numerical Recipes 3rd edition) and that requires me to supply a function ...
0
votes
1
answer
82
views
polynomial evaluation producing non-differentiable behavior in Python
I'm trying to evaluate a polynomial of degree 61. However, around the point sqrt(2) I get some weird behavior. The graph of the polynomial becomes erratic. What could be the reason for this. The ...
0
votes
2
answers
193
views
Why 5.0 / 2 returns 2.5000000000000000 (scale of 16) instead of 2.5 (scale of 1)?
Fiddle
select 5.0 / 2
, pg_typeof(5.0 / 2);
pg_typeof
2.5000000000000000
numeric
Why the result is 2.5000000000000000?
When we insert 2.5 into a numeric column or select 2.5 from a numeric column ...
5
votes
2
answers
94
views
How do I decode a bit string representing a n-digit number, where the 'n' digits were grouped and encoded in bit words of different lengths?
Background
I am trying to decode a bitstring from a QR-Code, where the data was encoded in numeric mode. According to this QR-Code tutorial: https://www.thonky.com/qr-code-tutorial/numeric-mode-...
1
vote
3
answers
153
views
With IEEE 754 floating point numbers, is underflow still better than overflow? [closed]
In his classic works from the 1970s, Richard Hamming advises setting up floating point calculations to be more likely to underflow than overflow.
For example, if you want to calculate 1 - 1/(exp(x)+1),...
0
votes
0
answers
39
views
Optimizing a numerical integration that involves matrices using sympy
The expression I'm integrating is
Where the latent variables are sampled from the a multivariate distribution as following:
And the random variables w_n given a latent variable is sampled from a ...
2
votes
1
answer
91
views
How can I approximate 255/sqrt(x) using Newton's method?
I am trying to approximate 255 / sqrt(x) using Newton's method to avoid using division or the sqrt() operation on an architecture where those operations are expensive.
My derivation is:
y = 255 / sqrt(...
1
vote
3
answers
217
views
How can I convert a list to numerical in r?
I am using the following data and have come across a roadblock.
I used read.csv to import my raw data into r.
# from OHP$ohp17.value
list(NULL, NULL, "19.9 nmol/L", "0.7 nmol/L", ...
0
votes
1
answer
31
views
"Stock" converted to a numeric value
Stock should be converted to a numeric valueBy replacing {stock[1]} by "available " to 100, and "limited stock" to 10, "out of stock" to 0. The idea is to work with ...
0
votes
2
answers
286
views
"ERROR: invalid input syntax for type numeric: NULL" postgresql
I'm starting to learn sql in porstgresql. I have create a table with numeric(6,2) structure and trying to import data. But data has some row that has NULL value. Now I'm getting "ERROR: invalid ...
1
vote
2
answers
212
views
vectorize an Ax=b solver
A lot of numerical solvers (such as this one), for some reason, only supports solving Ax=b where x, b are vectors.
What if I want to solve AX = B, where X and B are matrices.
I know numerically one ...
1
vote
1
answer
94
views
CFD Navier-Stokes Equation in Julia
so below is the code snippet i have for Julia:
using Printf
using Plots
gr()
# Parameters definition
Ny = 21 # Number of points in y-direction
Aspect_ratio = 10 # Ratio of ...
1
vote
1
answer
48
views
R issue with reshape, reshape is not ordering columns correctly
I am trying to use reshape function in R to arrange my data timepoints in a table. The variable that I am using to split it is numerical, but when reshape arranges the table it incorrectly puts 2,0.5,...
0
votes
0
answers
99
views
GA4 changing values to numeric changes the values
Bascially, i have a code that filters the data coming from the API. The data is reasonable, however, the values of the active Users are in string format. Once I changed them (to integers), my max ...
1
vote
1
answer
492
views
Byte size of numeric(precision, scale) in Postgres
Given that the size is variable, I am trying to calculate the average cost of a numeric(p, s) attribute. In my case, numeric(10, 2).
From what I understand of the Postgres documentation, this means I ...
2
votes
1
answer
686
views
Solving coupled 2nd order ODE, numerical in Python
I would like to solve the following DGL system numerically in python:
The procedure should be the same as always. I have 2 coupled differential equations of the 2nd order and I use the substitution g'...
1
vote
2
answers
137
views
How to prevent the program from returning 'inf'?
I am working on a famous classical physics problem: - the three body problem. I have made the follwoing program : -
#include <math.h>
#include <iostream>
using namespace std;
class ...
0
votes
2
answers
356
views
RAML validation for json array
In my API RAML, there is a query parameter named 'sfIds' which is an array type. I need to implement validation within the RAML to ensure that the array elements are always numeric, such as [111, 222, ...