Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
50 views

Datatype double declaration

I had a problem where, my answers were completely similar to the ones on the online judge, but they were deemed wrong. I fixed it after a lot of tinkering, but I dont understand what is going on. ...
stup's user avatar
  • 33
0 votes
0 answers
10 views

auto_arima claims an error. Data investigation says it's not there

Bit of digging says I may have stumbled upon a known issue. https://github.com/alkaline-ml/pmdarima/issues/404. Has anyone ever found a solution? I have a (nx1) dataset that I want to run a time ...
THill3's user avatar
  • 149
-1 votes
2 answers
82 views

Proper use of quotes in a command substitution - how? [closed]

In a rather large project, I run into the following problem: while calculating the correct command in a bash script, I don't manage to make the script respect the double quote necessary for single ...
udippel's user avatar
  • 141
0 votes
1 answer
114 views

Rounding when ULP 1 - Java and C++

The reason of the question originated from differences in the results that I observed when computing std::exp(x) in C++ against Math.exp(x) in Java (with x of type double). I noticed that the ...
Albert's user avatar
  • 29
0 votes
1 answer
42 views

React Native - Native Module - Double param not nullable (Bridge, Kotlin)

I’m trying to create a React Native Native Module using Kotlin. I want to use optional parameters, but the app crashes when I use Double?. Example: React Native: const {add} = NativeModules.MyModule; ...
Rebs's user avatar
  • 292
-6 votes
0 answers
144 views

Floating point numbers and computer arithmetic - Difference between Java and C++ [duplicate]

In Java, the double result of 1.0 / 20.0 is exactly 0.05. On the other hand, in C++ the result is 0.050000000000000003. Could someone help me to understand what is the specific cause of this ...
alberto's user avatar
  • 27
3 votes
1 answer
74 views

VBA: Strange behavior with Int function

I am wondering about this behavior that I see in VBA. I am using the Immediate console to debug my code and got the following result: Debug.Print(Int(0.00024575*10000000+0.5)) 2457 I would expect ...
Atreyu's user avatar
  • 671
0 votes
1 answer
38 views

In Java, Is possible to print doubles like this: "¹" instead of "^1"?

I have two variables, two double vectors. I want to print with Unicode like this: "1¹.¹¹¹¹" (the exponent would be the double), but I don't know how do it exactly. package Math; import java....
Bujakiewicz Franco's user avatar
0 votes
0 answers
22 views

Enabling the double-tap gesture on Apple Watch

I am trying to add double tap support in my watch app but i am facing "Cannot infer contextual base in reference to member 'primaryAction'" My testing device is watch os 10.5 version My ...
user2846204's user avatar
1 vote
2 answers
89 views

Input string was not in a correct format in event textbox changed with VB.NET [closed]

I'm Trying to use event textbox change but I have an error "Input string was not in a correct format " Is there something wrong with my code ? or Is there something wrong with my code ...
dlaksmi's user avatar
  • 137
0 votes
0 answers
21 views

IEEE754 Floating point conversion

can someone help with the following conversion? I have this data -eight ASCII character representation of a binary floating point, units are in percent 0 to +100.000% or -100.000% to +100.000%: ...
Al E's user avatar
  • 13
2 votes
2 answers
159 views

Why doesn't my manually entered double value match the expected value in C?

Question: As a beginner, i am curious about memory architecture and how values get stored in memory, so I tried this code. Nothing else. I'm trying to manually input byte values to create a specific ...
Nalan PandiKumar's user avatar
3 votes
1 answer
179 views

What happens when the integer value with more than 52-bit of mantissa is stored in the double data type?

#include <stdio.h> int main() { double a =92233720368547758071; printf("value=%lf\n", a); int i; char *b = &a; for (i = 0; i < 8; i++) { printf("...
Nalan PandiKumar's user avatar
0 votes
0 answers
37 views

What form is a floored or "ceilinged" double when cout represenation has no decimal point and looks like an int? [duplicate]

I wanted to know how to floor a double and I found my solution in this question. I decided to experiment so I wrote the code below. #include <iostream> #include <cmath> using namespace ...
heretoinfinity's user avatar
1 vote
0 answers
66 views

how to convert a double field to a string field remove decimal and zero

in a r script why when converting a double field to a character field, it adds a dot and a decimal to a duckdb table, how can i fix this? import duckdb # Connect to DuckDB database con = duckdb....
foo's user avatar
  • 19
4 votes
2 answers
128 views

Which Data Type should I use for Handling an ERP: BigDecimal or Double in Java?

I am currently developing an ERP (Enterprise Resource Planning) system and need to make decisions regarding the type of data to use for handling calculations and other numerical values within the ...
dssof's user avatar
  • 299
1 vote
1 answer
26 views

Hibernate problem in Oracle handling edge Double values

I'm testing the handling of basic Java values with Hibernate and Oracle. I have an Oracle table with a binary_double column, and I want to insert from Java the value Double.MAX_VALUE, which happens to ...
Ricardo Hoyos's user avatar
0 votes
0 answers
14 views

How to fix double slash url in wordpress which contains 404 error

I'm encountering an issue with one of my WordPress URLs, which is resulting in a double slash URL and a redirect error. How can I rectify this so that it gets indexed in the search console and ...
Vishal k's user avatar
0 votes
1 answer
66 views

How to convert a localized string number to a double?

In my code I have a number that has been set by a user through a TextField. struct ContentView: View { @State private var numberText: String = "" var body: some View { ...
Mark's user avatar
  • 18k
0 votes
1 answer
51 views

float/double is not working on qemu and spike for riscv-unknown-elf-gcc tool chain

float/double is not working on qemu for riscv-unknown-elf-gcc tool chain it is giving me exception trap_illegal_instruction I just tried running a simple program which has float in it, using riscv-...
Bheema Rohith's user avatar
1 vote
1 answer
70 views

Redeclaring a variable causes calculation errors [duplicate]

I was looking for calculation errors in an old C++ Win32 program compiled by VS Pro 2022. The problem was found to be caused by the following code which always produced a result of zero: double ...
Thunderdonkey's user avatar
0 votes
0 answers
62 views

Subtraction of doubles in c++

I have been doing some scientific computing working lot with very small and very big doubles with values in range between 1e-50 and 1e50. Nevertheless, the values never reach double limits, i.e. no ...
Camille Zaripova's user avatar
0 votes
0 answers
40 views

In Flutter, how to obtain width in pixels for a given fontSize?

I need to show double result in a TextField in Flutter app. Sometimes the results are so small number that the number is displayed in exponent like 1.123...e-17 . In some cases such results are not ...
rusty's user avatar
  • 178
0 votes
0 answers
35 views

why does not insert the (temp->rlink)->llink (circular double linked list)

I want to know why (*dlist)->llink is not x(lptint error) when i write &(temp->rlink) instead &x void lprintList(listPointer dlist) { listPointer temp = (listPointer)malloc(sizeof(*...
user24137190's user avatar
-1 votes
1 answer
51 views

Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures

Sorry for my bad english) I created a dynamic array of structures. This structures contains dynamic array of doubles. When I add the structure, I fill it this way The number of sides and the length of ...
Vladimir_gr's user avatar
1 vote
1 answer
45 views

Convert Cell Array of Symbolic Functions to Double Array of Symbolic Functions MATLAB

I have the following: syms x; F = {3*x,2*x,x}; I would like to make F the following array G: G = [3*x,2*x,x]; To do this, I have tried this: G = double(F); and this: G = double([F{:}]).'; Neither ...
Jonathan Frutschy's user avatar
0 votes
2 answers
49 views

why does the default round function in python fix double rounding errors?

There's something wrong with my understanding of either the round function in python or how doubles are represented in python. I find a very perplexing behavior when rounding numbers that have a ...
AXensen's user avatar
  • 101
0 votes
1 answer
61 views

How much accuracy is lost due to representing time as a IEEE 754 binary64 number?

My python program has a busy loop. Within the loop, some delays are calculated in the following fashion: timeout_s: float = args.timeout_s timeout_end_s: float = time.time() + timeout_s while True: ...
KamilCuk's user avatar
  • 137k
-1 votes
1 answer
64 views

Can't use double, can't use int, what do I use to stop the rounding? (Java) [duplicate]

I am incredibly new to java and this is the description for a lab I currently have: Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-...
thatlittlerose's user avatar
5 votes
1 answer
97 views

Determining the Upper Limit of Math.random() Output in Java

I'm seeking clarification on the upper limit of the numbers generated by the Math.random() method in Java. While I understand that the range of this method is "greater than or equal to 0.0 and ...
Brian Giroux's user avatar
1 vote
2 answers
336 views

How to set double precision for elements of an array in Fortran 90

I am not very familiar with Fortran code and want to compare it to some C code. I have the following definition for an array for which I want to have double precision (as I want to compare numbers ...
Mike's user avatar
  • 4,175
1 vote
3 answers
86 views

Why is double printing the same value as float in C when they have different sizes?

I need to do calculations using π. When I checked precision of M_PI, it only printed 7 decimal digits. So I #defined my own MY_PI. But I am still facing the same problem. double should support 15-17 ...
EMS's user avatar
  • 218
0 votes
1 answer
37 views

Calculate lowest common indivisible number in JavaScript

I am making API calls to a shipping provider. It returns the shipping price in the following format: "4250" which is actually $42.50. The API documentation says the following: Value in the ...
Nish's user avatar
  • 3
0 votes
1 answer
117 views

matrix type in R conversion

I have a matrix that looks like this : It seems that it is as I understand a numeric matrix . (it contains only values of 0,1,and 2) the sparse matrix is created with the package sim1000G : ...
liza read's user avatar
0 votes
0 answers
15 views

How can i solve the double scrollbar problem?

I just added the footer to my page and noticed that there are two scrollbars on the page. I tried to remove the footer, but nothing. My site: https://vilagtitkok.hu/ I tried to enter in css that ...
Balázs Tóth's user avatar
0 votes
0 answers
69 views

Facing issue while converting 18 digit double value to long

I am receiving double value [18-19 digits] as input to my method and I have to convert it to long value. I have no interest in handling the decimal part of input as input will always be ending with .0 ...
Keshav Singh's user avatar
-2 votes
1 answer
101 views

How Can Calculators Display So Many Digits of PI?

I was playing around with the calculator on my phone and I discovered I can see arbitrary numbers of digits of pi on there. I know double precision floats only have accuracy up to ~16 digits so I ...
chixken_tendies's user avatar
-3 votes
1 answer
63 views

calloc only return arrays of size 8 [duplicate]

I'm trying to create arrays of doubles in C, such that every array has d doubles in it (the user inputs d). I tried using calloc to allocate the memory for each array: double *vec; vec = (double*) ...
NivGeva's user avatar
1 vote
1 answer
148 views

How to use NumberFormatInfo

I want to be able to format any decimal number as I want. Specifically I want to be able to control: the number of decimals the decimal separator the thousand separator I have tried to do that var ...
Patrick's user avatar
  • 3,276
0 votes
1 answer
61 views

Integration in Octave between float point

I am trying to calculate the integral between two float points. The programm can do it, but it sends this next messagge warning: passing floating-point values to sym is dangerous, see "help sym&...
javi009's user avatar
  • 11
0 votes
1 answer
129 views

How to set locale in kotlin's decimal format

I use kotlin's decimal format and when my input is 15.4, my phone shows 15.4 instead of 15.4. But in the virtual machine on the computer, it still displays 15.4 correctly. I think this is a locale ...
NhatNS - Birthday Nguyen's user avatar
0 votes
1 answer
78 views

data type is double, but below decimal point is calculated 0

Code explain: When I input three number, each number is saved in list[]. And then, it prints average and standard deviation. Problem: standard_deviation value's below decimal point is calculated 0. I ...
Arin's user avatar
  • 1
-2 votes
1 answer
48 views

Coerce a list of data frames to a list of doubles

I am trying to use the function extractPosteriorMeans in the R package Siber to to get the means of a set of Bayesian posterior distributions. Normally, one of the arguments used for ...
ElizaBeso000's user avatar
0 votes
0 answers
126 views

Check whether two floating-point values are identical

In C#, how can I write a method bool AreSame(double x, double y) that determines whether two double values are not only equal but also identical? I'm aware of one case where two double values compare ...
Michael Liu's user avatar
  • 54.9k
7 votes
2 answers
186 views

strtod edge of denormals glitch

I have been looking at some code which had a weird optimisation fault and, in the process, stumbled upon a fault condition in strtod(), which has a different behaviour to strtof(), right on the edge ...
Martin Brown's user avatar
  • 2,299
0 votes
0 answers
32 views

Rounding and then Casting or vice versa

decimal value = Convert.ToDecimal(Math.Round(valueAsDouble)) decimal value = Decimal.Round(Convert.ToDecimal(valueAsDouble) Which is correct? What are the caveats?
participant's user avatar
  • 2,973
0 votes
0 answers
31 views

feedback controller for percentual variables

I am working on a control system which controls a system based on percentual parameters. Both the setpoint and output data are in percentages, as well as the integer value which is being controlled. I ...
Thomas's user avatar
  • 1
0 votes
2 answers
90 views

Printing doubles with large precision with printf, compiling with GCC

When printing with printf in a C program and specify how much characters I want after the decimal point with %.20f, it only gives me 15 characters and the rest are 0. I compile with GCC with the ...
KamenPetkov's user avatar
1 vote
2 answers
57 views

Accessing Double Pointers in C

Assuming these random methods void out_param_test(int *in, int **out) { int *temp = calloc(buffer_size, sizeof(int)); for (int i = 0; i < buffer_size; i++) { temp[i] = in[i]...
alexrider07's user avatar
-1 votes
3 answers
176 views

How to convert string into double value in C# [duplicate]

I am building simple C# Winforms desktop app using .NET framework. I need to convert a string like "172.5632" into double value. I tried Double.parse() and Convert.toString(). Both of them ...
GaoJin's user avatar
  • 9

1
2 3 4 5
168