Questions tagged [real-number]
The real-number tag has no usage guidance.
real-number
42
questions
0
votes
1
answer
49
views
Convert a real number into binary - assembly
I need to convert the entered real number into binary through assembler. I have this same code, only with integers and it works, but not here. When I enter with a period, e.g. 3.1 throws an error and ...
0
votes
0
answers
43
views
How to check for real numbers in bash script programming [duplicate]
I am learning Bash script and I need to write a conditional statement which make sure that my input string is a real number.
if [ is not a real number ]; then echo "not a real number"
I have ...
0
votes
0
answers
82
views
Fixed Point Notation (in Register)
As you know, fractional part of fixed point notation is can be different for different register. So, how is the fractional part determined according to the register bit address?
8 bits = 1 sign bit +...
0
votes
1
answer
127
views
Algorithm to Find Approximate Greatest Common Denominator for Noisy Data?
I have a set of values that are multiples of some greatest common denominator, and I need to find it. If they were exact values I could simply use e.g. Euclid's algorithm to find the GCD. The problem ...
0
votes
0
answers
438
views
Convert int to float in asm
Input are interger numbers and after calculation, i need the output is real number.
How can I do it?
Like when I enter 1,23,123 and the ouput of second calculation is -33 while the actual result is -...
0
votes
1
answer
115
views
Sql query with variables (real or integer)
I'm learning python... I tried to execute sql queries with parameters without success...
I tried:
from tkinter import*
import tkinter as tk
from tkinter import ttk
import sqlite3
realNumber = 2.0
...
1
vote
2
answers
116
views
How to format output in R containing both integers and real numbers?
The output of my code is following:
print(c(ax,bx,cx,dx))
>[1] 232.0000 2.0000 0.6578 1.2356
where in all the cases, the first two numbers are integers, and the rest are real. What should I ...
0
votes
1
answer
557
views
The function unique in R is not working for real numbers
I have a data frame that looks like following:
> con.hull.mod
x y
1 2.5558145 4.1739617
2 5.0180096 5.4267733
3 5.0180096 5.4267733
4 6.2151346 6.0358932
5 6.3582981 6....
0
votes
1
answer
92
views
How to convert real number between 0 to 1 into binary in Javascript?
I am trying to convert a real number (a) which is between zero and one to an array of bits.
I have tried this:
let a = 0.625
let b = []
while (a != 0) {
if ((a * 2) >= 1) {
b.push(1)
...
0
votes
0
answers
323
views
Regular expression for the set of all C real numbers
all the following patterns need to be accepted: 0, +0,-0, any integer, any integer preceded by + or - sign.
.3, 3.14, +3.14159, -3.14159, 0.123, -0.123, .123, +.123
12e+2, 7e-4, 6.3e2, 6.3e+2, 6.3e-2, ...
9
votes
2
answers
972
views
Real numbers in Coq
In https://www.cs.umd.edu/~rrand/vqc/Real.html#lab1 one can read:
Coq's standard library takes a very different approach to the real numbers: An axiomatic approach.
and one can find the following ...
1
vote
1
answer
2k
views
Plot real part of complex-valued function in Python
I am trying to plot the following function...
f(k) = Re[k - 0.5*(sqrt(1 - 4*k) + 1)]
for k = [-2, 2], but the best I can do is...
import matplotlib.pyplot as plt
import numpy as np
k = np.linspace(-...
2
votes
2
answers
262
views
In Coq, are there tactics for working with Rabs, Rineq?
I am new to Coq, and my primary interest is in using it to do simple real analysis problems. For a first exercise, I managed to bash through a proof that x^2+2x tends to 0 as x tends to 0. See code ...
0
votes
1
answer
1k
views
Large float and double numbers in java printing/persisting incorrectly. Is this behavior due to number of significant digits?
In an application I am working some numbers get converted and saved from long(18 digits) to float/double. These numbers are like Reference/Id's but not used for calculations. Recently I noticed some ...
0
votes
2
answers
83
views
AssertionError - imaginary and real numbers adder
I'm getting error:
java.lang.AssertionError: expected: learning.java.advancedoop2.MyComplex<(2.0+10.0i)> but was: learning.java.advancedoop2.MyComplex<(2.0+10.0i)>
Expected :learning.java....