Welcome to the NavList Message Boards.


A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding

Compose Your Message

Add Images & Files
    Re: Calculators, cosines, and floating point computation
    From: Frank Reed
    Date: 2019 Jun 10, 09:29 -0700

    Brad, you wrote:
    "I like the trick of a computation compared to the define. Clever."

    Haven't seen that one, eh? It's right out of the Mesozoic! Representing pi as 4·atan(1) used to be quite standard coding practice ...in the before time ...when code came on cards.

    You wrote:
    "I was tasked at GE with finding an indideous bug. "

    I think I found the source of your bug. :)

    Back to π... calculating tricks, like using the atan or the acos were common even two decades ago, but most languages and computation tools now provide a "safe" internal pi. You can search on "math.pi" for examples of these. You'll find some variant of that constant in the "math" object in javascript, lua, python, java... the list goes on. And in most spreadsheets, you get a system-precision limited value for pi using a standard math function =pi(). For everything you might ever do in navigation, these built-in values are the way to go. There are still rare cases where you may want more digits for some exercise in pure mathematics, and this is a nice application of Wolfram Alpha. Want pi to fifty digits? Then query with that exact text: https://www.wolframalpha.com/input/?i=pi+to+50+digits.

    Frank Reed
    PS: A reminder: the radius of the Earth is 3438 nautical miles... 'cause there's pi inside...


    Browse Files

    Drop Files


    What is NavList?

    Join NavList

    (please, no nicknames or handles)
    Do you want to receive all group messages by email?
    Yes No

    You can also join by posting. Your first on-topic post automatically makes you a member.

    Posting Code

    Enter the email address associated with your NavList messages. Your posting code will be emailed to you immediately.

    Email Settings

    Posting Code:

    Custom Index

    Start date: (yyyymm dd)
    End date: (yyyymm dd)

    Visit this site
    Visit this site
    Visit this site
    Visit this site
    Visit this site
    Visit this site