Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: precision of numbers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54108] Re: precision of numbers
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Thu, 10 Feb 2005 02:48:06 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 2/9/05 at 9:27 AM, fartous at mail15.com wrote:

>in the product: 15525600000*445.25*24 the output is:
>1.65907*(10^14) also when we use: N[15525600000*445.25*24, 15] the
>output is 1.65907*(10^14) but i want the precise number:
>165906561600000 what could i do jack

If you want an exact number then the best choice is to use only exact numbers to begin with, i.e.,

15525600000*(445 + 1/4)*24

If for some reason you must use inexact numbers (anything with an expressed decimal point) and want an exact number as the output, you would need to use a function that maps inexact numbers to exact numbers such as Round, Rationalize, Floor etc

For your particular example, Round does the trick as in

Round[15525600000*445.25*24]
165906561600000

More generally, Rationalize would be a better choice as in

15525600000*Rationalize[445.25]*24
165906561600000
--
To reply via email subtract one hundred and four


  • Prev by Date: Probable answer to a mystery
  • Next by Date: Re: Plotting just specific points
  • Previous by thread: Re: precision of numbers
  • Next by thread: Re: precision of numbers