Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
43 views

I have a Scheme interpreter written in JavaScript called LIPS. And a recent version of Node changed the precision of the floating-point numbers by one digit (Node 24, because of V8 change). So (expt 0....
4 votes
1 answer
54 views

I am running inference on a trained PyTorch model using the same input tensor, fixed random seeds, and evaluation mode enabled. import torch torch.manual_seed(42) torch.cuda.manual_seed_all(42) model....
1 vote
4 answers
297 views

My expected outcome is that I'm able to compare floats up to the sixth decimal point. The actual results are that they that it's incorrect, only sometimes though. Bonus if you can tell me why without ...
24 votes
4 answers
3k views

C23 added the classification macro iszero for testing whether an argument value is zero, specified like: int iszero(real-floating x); What is the difference between using iszero(x) and writing x == 0?...
3 votes
1 answer
262 views

Example: i = 292893227695 j = 8*i**2 + 1 k = math.sqrt(j) print(j) print(k) print(k.is_integer()) gives output 686291542636760920104201 828427149867.0 True Even though k is not an integer. More ...
9 votes
1 answer
186 views

[charconv.to.chars] says the following: The functions that take a floating-point value but not a precision parameter ensure that the string representation consists of the smallest number of ...
7 votes
2 answers
304 views

C23 now has four different ways of computing the maximum or minimum of two floating-point numbers: x > y ? x : y for maximum (or the other way for minimum) fmax / fmin fmaximum / fminimum ...
2 votes
2 answers
248 views

I write a cross-platform program for Windows and Linux, and I would like it to behave as similar on both platforms as possible. I use some mathematics in the program, e.g. std::atan2 function calls, ...
Fedor's user avatar
  • 24.9k
2 votes
3 answers
228 views

C23 §5.2.5.3.3 [Characteristics of floating types <float.h>] paragraph 8 says: Floating types shall be able to represent signed zeros or an unsigned zero and all normalized floating-point ...
2 votes
2 answers
139 views

In Kotlin, if you do println(String.format("%.17f", 10.45)), you will see 10.45000000000000000 in the output. In Swift, if you do print(String(format: "%.17f", 10.45)) you will see ...
3 votes
1 answer
248 views

The inverse of the gamma function over the reals is multivalued with an infinite number of branches. This self-answered question is about the principal inverse of the gamma function, Γ0-1(x), whose ...
4 votes
3 answers
258 views

I am in the process of upgrading our code from php 8.2 to 8.4 I noticed we are getting some test failures because of round() returning different values than expected. Ultimately the problem could be ...
4 votes
1 answer
148 views

Consider the following snippet: ldr q0, [x0] cmeq v0.16b, v0.16b, #0 shrn v0.8b, v0.8h, #4 fcmp d0, #0.0 This is a common way to implement functions such as strlen with SIMD. According to the Arm64 ...
Advice
2 votes
10 replies
191 views

Is the minimum range that remquo(x, y, quo) assigns *quo [-7 ... +7]? Is not, what is the minimum compliant range? double remquo(double x, double y, int *quo); has the following description: The ...
chux's user avatar
  • 158k
16 votes
2 answers
740 views

I have a program that reads the coordinates of some points from a text file using std::istringstream, and then it verifies the correctness of parsing by calling stream's operator bool(). In general it ...

15 30 50 per page
1
2 3 4 5
...
1034

AltStyle によって変換されたページ (->オリジナル) /