Yes, precisely downwards nearest multiple. The original idea is whether a function can return a value to a given precision (something like floor, round). Furthermore, it will be more useful if it works for more general precision, say 0.05, 0.02, 0.03...
On Friday, October 9, 2015 at 12:24:51 PM UTC+2, Stefan Karpinski wrote: > > What is the behavior of this function supposed to be? F(a,b) is the > nearest multiple of b to a? I'm curious what definition is consistent with > all three given examples. > > On Thu, Oct 8, 2015 at 9:20 PM, Isaiah Norton <[email protected] > <javascript:>> wrote: > >> See >> http://julia.readthedocs.org/en/latest/manual/integers-and-floating-point-numbers/#rounding-modes >> and the rest of the discussion on that page. >> >> On Thu, Oct 8, 2015 at 11:01 AM, Sisyphuss <[email protected] >> <javascript:>> wrote: >> >>> Hello everyone, >>> >>> I want a function F(), so that >>> F(0.154, 0.1) = 0.1 >>> F(0.154, 0.01) = 0.15 >>> F(0.154, 0.003) = 0.153 >>> >>> I tried `div(a,b)*b`. However, I got: >>> >>> div(0.128,0.0001) * 0.0001 = 0.1279 >>> >>> not equal to 0.1280 >>> >>> Any solution? >>> >> >> >
