Re: Ceiling & Floor

*To*: mathgroup at yoda.physics.unc.edu*Subject*: Re: Ceiling & Floor*From*: wheeler at super.org (Ferrell S. Wheeler)*Date*: Thu, 26 Mar 92 11:51:48 EST

>> Ceiling[10^30 + 3.333] returns 1000000000000000019884624838656 > This is NOT a bug. > Arithmetic with machine numbers results in machine numbers (unless the result > can't be expressed as a machine number due to overflow or underflow.) > 53 or 64 (or whatever your machine happens to use) bits is insufficient > to give any digits to the right of the decimal point. Ceiling[ ] and Floor[ ] > have nothing to do with it. > > Jerry B. Keiper > keiper at wri.com I too understand why it did what it did, that does not mean this behavior is the "correct" behavior. The expression as typed makes absolutely perfect sense mathematically. I offer as evidence that Mathematica is not as stupid as you would have us believe: Ceiling[100000000000000000000000000000. + 3.333] Floor[100000000000000000000000000000. + 3.333] both return the mathematically correct answer. Now the precision of the initial summand is 30ish whereas in the initial example the first summand had infinite precision. Take care, Ferrell Wheeler wheeler at super.org