15,886,258 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Andy Allinger (Top 4 by date)
Andy Allinger
3-Jun-19 3:41am
View
Deleted
Could you please explain what your script does for those us who don't know ksh?
Andy Allinger
25-Apr-17 1:17am
View
My apologies. Changed program to DOUBLE PRECISION for 64-bit math. It turns out that your answer for .00205501 was better, and that the Pi approximations were wrong too.
with 1 digits, approx of pi is 3 1/7
with 2 digits, approx of pi is 3 14/99
with 3 digits, approx of pi is 3 16/113
with 4 digits, approx of pi is 3 16/113
with 5 digits, approx of pi is 3 14093/99532
with 6 digits, approx of pi is 3 140914/995207
with 7 digits, approx of pi is 3 244252/1725033
DF2F(.00205501D0, 6): 1829/890020
Why did I ever doubt the mathematicians?
Andy Allinger
23-Apr-17 22:35pm
View
3.1415927 is as close as possible in 32-bit math.
Andy Allinger
23-Apr-17 20:56pm
View
The Farey tree gives the answer to a subtly different question: find the smallest fraction to approximate within a given tolerance. Brute force will find the best approximation, up to machine precision