Re: Next representable number
- To: mathgroup at smc.vnet.net
- Subject: [mg73593] Re: [mg73542] Next representable number
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 22 Feb 2007 04:42:20 -0500 (EST)
- Reply-to: hanlonr at cox.net
myCeiling[x_, digits_]:=Module[{incr=10^-digits},incr*Ceiling[x/incr]]; Table[myCeiling[Pi,n],{n,0,6}]//N {4.,3.2,3.15,3.142,3.1416,3.1416,3.14159} Bob Hanlon ---- Andrew Moylan <andrew.j.moylan at gmail.com> wrote: > What's a neat way to determine the next (higher) representable number > (at a given precision)? That is, I want f[x] to be the smallest > representable number (at precision Precision[x]) that's larger than x.