Skip to main content
Filter by
Sorted by
Tagged with
4 votes
2 answers
233 views

So I can generate many tuples like this: (...
Ξένη Γήινος's user avatar
3 votes
2 answers
149 views

I have the following vector. Vector_1 <- c(0.1, 0.9, 0.5, (1 / 3), 0.5344) I want to multiply each element of this vector by the same number such that each number in the resulting vector is an ...
David Moore's user avatar
  • 1,026
0 votes
1 answer
40 views

Im having 2/1/2025 in this mat-datepicker but it shows the number as a fraction. Im trying to see the date in the correct format. Example ` <mat-form-field appearance="outline" color=&...
Ariel Spais's user avatar
1 vote
1 answer
192 views

Here is an example which demonstrates the problem: var fdt, fndt : Double; dt, dt2 : TDateTime; begin dt := EncodeDateTime(2023, 12, 31, // 20, 10, 5, 100); dt2 := EncodeTime(20, ...
durumdara's user avatar
  • 3,483
0 votes
1 answer
74 views

I am using Visual Studio 2022 I tried to display on the screen a fraction in math the code is "\frac{ 2}{ 6}" but the vs2022 color only the "\f" and instead of writing a fraction ...
user26320488's user avatar
-1 votes
1 answer
100 views

Whenever a user inputs a fraction, it might be contain decimals (long double). I have some code (C++) below to show how I implement this: class Fraction { public: long double numerator, ...
hello there's user avatar
1 vote
0 answers
39 views

We have a Variation SKU: W-250-1/4 (the 1/4 represents lifting speed) however Woocommerce convert the text to a fraction please see Image 1 (shows Variable SKU): and Image 2 how it is displayed: The ...
stratalign_nz's user avatar
1 vote
1 answer
76 views

I have troubles in evaluating terms of a matrix nxn, where, starting with the first 3 rows, I compute the rest of the matrix with an algorithm which have a quite complicated loop. I'm trying to write ...
Maxim Tiburziano's user avatar
2 votes
0 answers
250 views

I am attempting to implement an algorithm to convert decimal numbers into simplified fractions in C. To achieve this, I am using the decimal_to_fraction function which utilizes the Euclidean algorithm ...
Unsigned Index's user avatar
1 vote
5 answers
215 views

What would be the best way to encode a positive simple fraction on 32 bits or 64 bits? For casual binary fraction, we already have a well defined standard for floats and doubles. In case of 32 bits, ...
Amae Saeki's user avatar
2 votes
1 answer
180 views

I'm new to using manim and I try to implement a simple animation for a continued fraction expansion of a fraction. My code so far is as follows: from manim import * class Eq(Scene): def construct(...
Maik Pickl's user avatar
0 votes
2 answers
135 views

How are the fractions different to percentage? Is there any difference in the below codes? grid-template-columns: 1fr 1fr 1fr 1fr; /* --------vs-----------*/ grid-template-columns: 25% 25% 25% 25%; ...
debh-2024's user avatar
-1 votes
3 answers
670 views

In my project, I built my own Fraction: public partial struct Fraction { public double Numerator; public double Denominator; public readonly decimal Quotient { get { ...
Mr_Sure21's user avatar
0 votes
3 answers
158 views

I'm a python beginner, and I'm trying to create a simple triangle calculator. Right now, I'm trying to have an inputted fraction be turned into a float so that I can multiply it by math.pi and do what ...
Jayant Goyal's user avatar
0 votes
1 answer
142 views

I used the math.js library to be able to create a calculator which converts any number from radian to degree or vice versa. The calculations work perfectly, but the problem comes when trying to ...
Matias Leon Lau's user avatar
2 votes
2 answers
133 views

My assignment asks me to take a data set in the form of different integers, and run them through a method that will print the appropriate number of characters to create a horizontal bar graph. The ...
Charlimagne's user avatar
2 votes
3 answers
168 views

I am trying to do something like as below #include <stdio.h> int main() { float a = 0b00000100; float b = 0b0.0110; // this line is not working printf("The value of first float ...
Tah_Ra's user avatar
  • 128
1 vote
1 answer
82 views

I am wondering which mistake the following Haskellcode has! f :: Fractional a => a -> a -> a f x y | x > y = x - y | otherwise = x + y call = f 3.5 2.0 I was trying to solve the problem ...
svenjaleo's user avatar
1 vote
1 answer
194 views

I'm starting with scilab. I can't do partial fractions. How can I solve that? this is my code: Thanks in advance num = 22801+4406.18*%s + 382.37*%s^2 + 21.02*%s^3; den = 22952.25 + 4117.77*%s + 490.63*...
cayito_arcade's user avatar
0 votes
0 answers
171 views

I have three variables uint_8 a = The integer value lets say 11111100, uint_4 b = The fractional part of a. lets say .1001, float c where a is 8 bits and b is 4 bits. Is there anyway that I ...
Tah_Ra's user avatar
  • 128
1 vote
0 answers
56 views

I need to find minimum positive value of this function, where a_i and b_i are real constants and all s_i are equal to plus or minus one: I can make it in ~n*2^n operations by brute force complete ...
Stepan Yakovenko's user avatar
0 votes
1 answer
861 views

I have an Excel spreadsheet with the following data in A1 and A2(column is formatted as Text). A 1 258.1875 2 294.1875 I need the data to display in B1 and B2 in feet and inches, like this: (column ...
Connie Zboral's user avatar
0 votes
1 answer
673 views

I want to convert a column that appears to me as text that contains numbers with a decimal point to a field that will be a normal number so that I can sum up the column. Columns that appeared to me as ...
Hodaya Gana's user avatar
0 votes
1 answer
98 views

Does anyone know a way I can put in 9/10 or similar without getting the "Not a real value text"? It works fine with single digits like 3/4, 2/5 but if I put in 2/10 I get the error. while ...
Big_Port's user avatar
-1 votes
1 answer
71 views

Why with double number = double.Parse(Console.ReadLine()); Console.WriteLine($"{number:0.00}"); or double number = double.Parse(Console.ReadLine()); Console.WriteLine("{0:0.00}", ...
Stefan's user avatar
  • 1
1 vote
1 answer
118 views

import sympy as sp from fractions import Fraction M = sp.symbols('M') diffs = [None, 0, 5*M/2 - 3.5, 0.5 - 3*M/2, -M, M/2 - 1.5, 0, 1.5 - 3*M/2] #Convert terms of expression to fractions (none of ...
Elektvocal95's user avatar
0 votes
2 answers
102 views

import sympy as sp from fractions import Fraction new_matrix_aux = [['X', 'B', 'X1', 'X2', 'X3', 'X4', 'X5', 'U1', 'U2'], ['X2', 10/3, 0, 1, 2/3, 1/3, -2/3, -1/3, 2/3], ...
Elektvocal95's user avatar
1 vote
2 answers
674 views

Big numbers with fraction support: I want to perform math operation with no precision loss. How can I do it using JavaScript? First I tried decimal.js, but it does not preserve precision as you see in ...
valerii15298's user avatar
0 votes
1 answer
476 views

I can convert Decimal to Fractions in Excel. i.e. 1.25 to 1 1/4 However, I want it to appear in the format 1¼ with the fraction in superscript and subscript format. Is there a VB code for doing this? ...
Garrod James Hutchison's user avatar
0 votes
2 answers
978 views

Im trying to print out a whole numbers alongside rational fractions E.g: 3 1/2 , **not **7/2 I wanted to try to use if statements like if num1 >= den1: whole += though i was afraid that wasnt ...
elfuegoeggo's user avatar
10 votes
2 answers
619 views

In my problem I have to write a program that calculates all the unique unit fractions (1/2 +1/3 + 1/6 = 1) that sum to one. I am currently at 570 fractions that sum to one in this format where the ...
Denlolsauce's user avatar
0 votes
1 answer
76 views

I currently have a big-num implementation based on rational numbers (with repeating digits) that stores the following (in binary): Integer part Fraction part Repeating fraction part Some examples (...
Filipe Rodrigues's user avatar
0 votes
2 answers
93 views

I've an expression that after simplify method looks like this: 5*y**3/2 I would like to see expression in this view: (5/2) * y ** 3 but I have no idea how to do this. Thanks in advance.
Davidebe's user avatar
0 votes
2 answers
73 views

I am using the class constructor Fraction to create fractions. What is the difference between using the Fraction class constructor and from_float method when creating fractions from floating-point ...
winter's user avatar
  • 53
1 vote
0 answers
72 views

I'd like to cancel a rational function f1(z)=p1(z)/q1(z) given by two polynomial expressions p1,q1. An almost complete solution would be the following import sympy as sp z = sp.symbols('z') p1 = z**2 -...
flonk's user avatar
  • 3,916
1 vote
1 answer
77 views

I want to make a ml to oz converter and present the remaining decimal in fraction formats 1/2, 1/3, 2/3, etc... As example 50 ml would be 1 2/3 oz. The integer is on the left side, and the decimal on ...
robtot's user avatar
  • 1,069
0 votes
1 answer
84 views

A program takes two long fractions, and performs addition, subtraction, multiplication and comparison operations on them. In the standard CLion compiler (MinGW) the code is executed correctly, but in ...
nklobas's user avatar
  • 13
0 votes
1 answer
125 views

I am doing a simple test to understand signed fractional multiplication in ordinary format and in Q(4,20) format (https://en.wikipedia.org/wiki/Q_(number_format)). I am using the fxpmath library (...
user2532296's user avatar
0 votes
1 answer
68 views

I am getting unexpected results when multiplying 2 fractional numbers. If i use a calculator (google) to check my sums, i get the correct answer (or the answer i am expecting) This is an example of ...
Jon's user avatar
  • 3
0 votes
1 answer
65 views

The formula for solving binary point into decimal point is... if 10.110 then: 1x10\*\*-1, 1x10\*\*-2, ... but my code is so messed idk... The output of this should be .75 string a = "10....
user avatar
0 votes
1 answer
186 views

Motivation I need to instance fractions in my code without the rounding error of floating point values. Therefore, I decided to use a pair of integer values, one for numerator and the other one for ...
waterstopper's user avatar
2 votes
1 answer
1k views

I'm trying to solve a problem about Bernoulli numbers using Python. The aim is to output the numerator and the denominator of the $n$-th Bernoulli number. I use the conventions and the generic formula ...
Barbara Gendron's user avatar
3 votes
1 answer
309 views

I'm trying to convert very large integers to decimals, then convert those decimals to Fractions, and then convert the Fraction back to a decimal. I'm using the fractions and decimal packages to try ...
Einsneins's user avatar
0 votes
1 answer
684 views

I want to get numerator and denominator from decimal and then simplify both numerator and denominator. For example, if decimal is 0.05, then numerator and denominator should be 1/20. Preferably ...
BasicallyIAmFox's user avatar
1 vote
1 answer
1k views

I have a global IGBP land use dataset in which the land cover exists out of forest cover (depicted with a '1') and non-forest cover (depicted with a '0'), hence, each land grid cell has either the ...
Freek's user avatar
  • 15
0 votes
2 answers
203 views

I have the following fraction: import sympy as sp a = sp.Symbol("a") b = sp.Symbol("b") a/(a+b) And would like to print it as 1/(1+b/a) I saw sympy had a factor function but I ...
Rémi Delaporte-Mathurin's user avatar
-2 votes
1 answer
199 views

I'm trying to read "fractions" from a .txt file and store them in an array to later perform the sum and then simplify the result. Fractions in the text file are represented as follows(...
Sergio Alejandro Vazquez Rodrg's user avatar
0 votes
2 answers
94 views

The deviations of the mean should always sum up to 0. However, when the mean has a lot of digits, maybe infinitely like this one which is 20/7, R fails to calculate it. x <- c(1,2,2,3,3,4,5) sum(x -...
uke's user avatar
  • 874
0 votes
1 answer
571 views

I'm used to formatting fractions in Google Sheets as '# ##/##', is there any way to do the same in Python or do I have to program it? I have tried: F'Value: {Fraction(a / b).limit_denominator()}' ...
Thants's user avatar
  • 1
3 votes
1 answer
149 views

I need to do math on big fractions, so in addition for example, I need to have same denumerator, multiplying these big fractions makes them go over long(java) type limit. Using float or double seems ...
Nignik's user avatar
  • 31

1
2 3 4 5
17