GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Viorel/RationalApproximation: Approximate a decimal or rational number with bounded nominator and denominator.

BranchesTags
Open more actions menu

Latest commit

 

History

40 Commits
40 Commits

Folders and files

NameName
Last commit message
Last commit date
RationalApproximation
RationalApproximation
 
 
RationalApproximationLibrary
RationalApproximationLibrary
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
RationalApproximation.slnx
RationalApproximation.slnx
 
 
Screenshot1.png
Screenshot1.png
 
 

Repository files navigation

Rational Approximation

An experimental tool to find the rational approximation of decimal and rational numbers, specifying the maximum numerator and denominator (in digits, bits or maximal value).

Examples of calculations

(Let us limit the numerator and denominator to three digits).

Input Rational Approximation
0.12345 119 / 964
1234 / 5678 153 / 704

The program supports repeating (recurring) decimals using the “( )” notation, as well as exponents:

Input Rational Approximation
0.(3) 1 / 3
0.12(345) 10 / 81
0.8(9) 9 / 10
1.234e-4 617 / 5

If the input number is too close to zero or too large, and the maximum number of digits is insufficient, then the result may include an exponent, for example:

Input Rational Approximation
1.2345e-7 458e-7 / 371
1234567/89 799e+4 / 576

The program also accepts the name of some common constants:

Input Rational Approximation
pi 355 / 113
e 878 / 323

(The approximate values of these constants consist of 1000 digits).

As an experimental feature, the program also supports non-periodic continued fractions:

Input Rational Approximation
[5; 6, 7, 8] 919 / 178

A view of the program

Screenshot

Usage

The program runs in this environment:

  • Windows 11 or Windows 10 (64-bit),
  • .NET 9.

To use it, download and unzip the latest archive from the Releases section. Launch the RationalApproximation executable.

Alternatively, the program can be compiled in Visual Studio 2026. The “.NET desktop development” workload is required. The source files can be got from the Releases section. The program is made in C#, WPF.

References

  • Wikipedia contributors. Farey sequence — https://en.wikipedia.org/wiki/Farey_sequence
  • Cook, John D., Rational approximation to a decimal number — https://www.johndcook.com/rational_approximation.html


About

Approximate a decimal or rational number with bounded nominator and denominator.

Topics

csharpdecimal-numbersfarey-sequencefractionsrational-approximationrational-numberswpf

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.