My Math Forum  

Go Back   My Math Forum > Science Forums > Computer Science

Computer Science Computer Science Forum


Reply
 
LinkBack Thread Tools Display Modes
November 3rd, 2007, 11:48 AM   #1
Senior Member
 
Joined: Apr 2007

Posts: 2,140
Thanks: 0

Double-Precision in C++

The following source code includes the term "double". I need to know the exact defintion of "double". I kinda know what it means, but I still need to know what is the term "double" is for.
Code:
#include <iostream>

int main()
{
            double radius;
            double area;

            // Step 1: Read in radius
            radius = 20

            // Step 2: Compute the area
            area = radius * radius * 3.14159

            // Step 3: Display the area
            std::cout << "The area is " << area << std::endl;

            return 0;
}
johnny is offline  
 
November 3rd, 2007, 02:11 PM   #2
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 937

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Double-Precision in C++

Quote:
Originally Posted by johnny
The following source code includes the term "double". I need to know the exact defintion of "double". I kinda know what it means, but I still need to know what is the term "double" is for.
Without knowing why you want to know, I risk giving too much or too little information.

"double" is like "float", except it typically uses twice as many bits. Double is usually 64 bits, holding values up to about 10^308. It has all the special characteristics of float: infinities, NaN, signed zeros, and subnormal numbers.
CRGreathouse is offline  
Reply

  My Math Forum > Science Forums > Computer Science

Tags
doubleprecision



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
trig equation involving precision. minimalmiser Algebra 6 December 29th, 2010 05:38 AM
binomial series precision povilasb Pre-Calculus 8 December 25th, 2010 10:49 AM
Recall/Precision jimmyfo Algebra 1 November 28th, 2009 07:39 AM
Maxima: More precision in draw3d objects adanedhel728 Applied Math 0 November 9th, 2009 11:15 PM
[Arbitrary-precision] Calculating mathematical constants CRGreathouse Applied Math 2 December 13th, 2006 08:12 PM





Copyright © 2018 My Math Forum. All rights reserved.