Circumference of circle to many decimal places


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Circumference of circle to many decimal places

    But in C, since you usually have math.h with floating point, you wouldn’t actually do that.
    This was part of a challenge with strict constraints.

    To do it in C, it’s:
    Code:
    float circ;
    float radius;
    const float pi = 3.1415; // or however far you want to take it
    
    radius = 10.0
    circ = (2*pi)*radius;

  2. #2
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: Circumference of circle to many decimal places

    const float pi = 3.1415; // or however far you want to take it
    With a single precision float that's about as far as you can take it... 6-7 digits.

    You'll almost certainly never get the 17 digit answer.

Similar Threads

  1. Want to display less decimal places on LCD from 16bit ADC
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th June 2015, 23:14
  2. Replies: 2
    Last Post: - 8th April 2012, 16:11
  3. How long does this circle take?
    By IAmTheAnswer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th May 2010, 16:14
  4. Bcd-->Decimal please help
    By memo333 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th January 2006, 12:27
  5. Decimal value
    By leonel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th April 2005, 17:39

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts