fractions Questions
4
Solved
I'm currently puzzling over the response provided by the class method Float>>asFraction and its various forms. Here are a few examples:
GNU Smalltalk
0.001 asFraction
1/1000
0.001 asExactFrac...
Traceable asked 18/2, 2021 at 1:47
4
Solved
I found a problem related to rational numbers.
Two rational numbers are given and the task is to find the simplest rational number between them.
For this problem, the simplicity of a rational num...
Vieira asked 1/7, 2016 at 8:43
10
Solved
What I need to convert decimal to fractions. It is easy to convert to 10's feet.
1.5 => 15/10
This can do via this code:
public class Rational {
private int num, denom;
public Rational(d...
2
Solved
Now, floating and double-precision numbers, although they can approximate any sort of number (although the same could be said integers, floats are just more precise), they are represented as binary...
Vernal asked 22/7, 2014 at 21:52
2
Solved
What is best way to represent fractions in F#? Haskell and Racket have convinient way to represent ratios. Is there a data type in F# to represent ratios?
Porcine asked 17/3, 2011 at 2:54
2
When calculating a proportion (0 < x < 1) I am looking to convert that result x into it's nearest 1/r form, so that for example for
x = 0.30 is converted into 1/3
whereas for
x = 0.29 is ...
2
Solved
I've recently run into an issue where I got a segfault in MSVC where I wouldn't in GCC.
After hours I realized that apparently my version of MSVC does not support the following syntax:
double va...
Zolner asked 20/5, 2019 at 14:33
7
I have a list of fractions, such as:
data = ['24/221 ', '25/221 ', '24/221 ', '25/221 ', '25/221 ', '30/221 ', '31/221 ', '31/221 ', '31/221 ', '31/221 ', '30/221 ', '30/221 ', '33/221 ']
How wo...
Adult asked 26/8, 2010 at 19:5
11
Solved
Is there any controls available for star rating in ios ? So i can use that in UITableviewCell ??
I know there are some open open source controls like DYRating etc.. But iam not able to add it in ...
Ohaus asked 19/4, 2013 at 8:25
2
Solved
I want to display double value as fraction in C#, how can I do this ?
Thanks
2
I'm trying to implement the simplex method in Python so I need to use the Gaussian elimination on arrays. Very often fractions come up and for more clarity and precision I would like to keep the fr...
13
Solved
In C++, When I calculate 2/3, it will output decimal values, how can I just get the original format (i.e.g 2/3) instead of 0.66666667
Thanks
3
Solved
I am aware of the nature of floating point math but I still find the following surprising:
from fractions import Fraction
print(Fraction(0.2)) # -> 3602879701896397/18014398509481984
print(Fra...
Kalakalaazar asked 9/2, 2018 at 13:34
2
Solved
I'm trying to do some analysis over a simple Fraction class and I want some data to compare that type with doubles.
The problem
Right know I'm looking for some good way to get the density of Frac...
2
I'm working on a harmonic ratio program and part of what I want a user to be able to do is plug in various ratios and have the decimal-valued frequency that's playing show you more ratio-locked fre...
3
Solved
I've been using Python to calculate math equations. For example:
from sympy import Symbol, Derivative, Integral
x = Symbol('x')
d = Symbol('d')
Integral(8*x**(6/5)-7*x**(3/2),x).doit()
Which res...
2
Can anyone explain ULP Unit of least precision?
I have the following definition, but it is still not clear
"The size of the error when representing fractions is proportional to the size of the n...
1
Solved
I compute the reverse of matrix A, for instance,
import numpy as np
A = np.diag([1, 2, 3])
A_inv = np.linalg.pinv(A)
print(A_inv)
I got,
[[ 1. 0. 0. ]
[ 0. 0.5 0. ]
[ 0. 0. 0.33333333]]
B...
2
Solved
What is the difference is between the Floating and Fractional classes in Haskell?
Limpid asked 31/1, 2017 at 17:50
2
Solved
I have a text file of numerical data, with headers, where some numbers are entered as fractions, some are entered as integers, and some are entered as floats, e.g.:
col1name, col2name, col3name, c...
2
Solved
While doing exercise on the topic of float type to Fraction type conversion in Python 3.52, I found the difference between the two different ways of conversion.
The first method is:
>>> fr...
Eaddy asked 3/7, 2016 at 16:58
4
Solved
3
I'm having great difficulty with the following that I need to do for an assign:
a. Declare a data structure that contains a rational number.
b. Write f'xns that will +, -, *, / rational numbers.
Al...
Intellectualism asked 24/11, 2015 at 7:14
3
Solved
Is there a simple method to (attempt to) rationalize all numeric values in an expression within a given delta, much like Rationalize[] in Mathematica?
An example in Mathematica:
In[25]:= Rational...
2
Solved
So I'm learning that Lisp does fractions which is great. But why then does this equality check return NIL:
* (= 0.2 1/5)
NIL
...while it returns True if it's converted to float first:
* (= 0...
Titania asked 1/10, 2015 at 14:3
© 2022 - 2024 — McMap. All rights reserved.