815 questions
3
votes
2
answers
181
views
How to get specified number of decimal places of any fraction?
So I can generate many tuples like this:
(...
3
votes
2
answers
121
views
Finding the Least Common Multiplier to Turn a Vector of Numbers Into Integers
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 ...
0
votes
1
answer
22
views
Strange Date format in mat-datepicker
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=&...
1
vote
1
answer
154
views
Delphi EncodeDateTime and EncodeTime Time portions are different
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, ...
0
votes
1
answer
54
views
fraction not display instead down a line
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 ...
-1
votes
1
answer
90
views
Is there a way to simplify a fraction including decimals? [duplicate]
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, ...
1
vote
0
answers
31
views
SKU in Woocommerce displays the text 1/4 as a fraction
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 ...
0
votes
0
answers
28
views
How to represent fraction text value like ⅑ but with a straight divider like given in the image?
I am using fabric js textbox and on a click of a button a fraction string gets added to the textbox, Currently as a workaround I'm showing fractions like ⅑ but I have to represent the fractions with a ...
1
vote
1
answer
64
views
Issues in computing matrix numerical terms. Is Julia wrong in evaluating the result?
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 ...
2
votes
0
answers
239
views
How to correct the conversion of decimal numbers to simplified fractions using the Euclidean algorithm? [closed]
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 ...
1
vote
5
answers
159
views
What would be the most efficient way to encode a simple fraction on 32 or 64 bits? [closed]
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, ...
2
votes
1
answer
143
views
Continued fractions in manim
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(...
0
votes
2
answers
92
views
CSS Grid: What is the difference between fraction vs percentage?
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%;
...
-1
votes
3
answers
605
views
How to Generate a Random Fraction Within a Specific Range
In my project, I built my own Fraction:
public partial struct Fraction
{
public double Numerator;
public double Denominator;
public readonly decimal Quotient
{
get
{
...
0
votes
3
answers
137
views
Converting inputted fractions into decimals
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 ...