Article View: alt.comp.lang.learn.c-c++
Article #626Re: How to do floating point division?
From: Claudius Proculus
Date: Fri, 19 Feb 1999 00:00
Date: Fri, 19 Feb 1999 00:00
31 lines
1640 bytes
1640 bytes
In article <7ake0p$n4$1@news6.svr.pol.co.uk>, "John Burton" <jb@jbmail.com> wrote: >Jules wrote in message <7Riz2.11845$cQ5.6291@nnrp2.clara.net>... >>Dear all, I want to do a const line like this in C++: >> >>const float pi = 22/7; >> >>but '/' will only return an int, so how do I have a float to store in pi? >> >>Thanks, >> Jules >> > > >const float pi = 22.0/8.0; or better yet const double pi = acos (-1.0) ; John - N8086N Wise man says "Never use a bank with the initials F. U." ------------------------------------ JPEG ----- Are you interested in a professional society or guild for programmers? See www.programmersguild.org/american.htm EMail Address: _m_i_a_n_o_@ _c_o_l_o_s_s_e_u_m_b_u_i_l_d_e_r_s. _c_o_m_
Technical Details
Message-ID:
<7akjob$7uk$2@birch.prod.itd.earthlink.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7Riz2.11845$cQ5.6291@nnrp2.clara.net> <7ake0p$n4$1@news6.svr.pol.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb1d5,e29ff327add874ff X-Google-Attributes: gidfb1d5,public X-Google-Thread: 143fed,e29ff327add874ff X-Google-Attributes: gid143fed,public X-Google-Thread: 114592,e29ff327add874ff X-Google-Attributes: gid114592,public X-Google-Thread: 109fba,e29ff327add874ff X-Google-Attributes: gid109fba,public From: x@xz.nl (Claudius Proculus) Subject: Re: How to do floating point division? Date: 1999/02/19 Message-ID: <7akjob$7uk$2@birch.prod.itd.earthlink.net> X-Deja-AN: 446200834 References: <7Riz2.11845$cQ5.6291@nnrp2.clara.net> <7ake0p$n4$1@news6.svr.pol.co.uk> X-Posted-Path-Was: jmiano X-ELN-Date: 19 Feb 1999 21:06:19 GMT X-ELN-Insert-Date: Fri Feb 19 13:15:03 1999 Organization: EarthLink Network, Inc. Newsgroups: alt.comp.lang.learn.c-c++,claranet.local.help,claranet.local.tech,comp.lang.c++