On 06 July, 2015 - Robert C. Helling wrote: > > > On 05 Jul 2015, at 21:31, Dirk Hohndel <[email protected]> wrote: > > > > On Sun, Jul 05, 2015 at 12:11:15PM -0700, Linus Torvalds wrote: > >> On Sun, Jul 5, 2015 at 11:56 AM, Dirk Hohndel <[email protected]> wrote: > >>> static inline depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit, > >>> int roundto) { > >>> depth_t depth; > >>> depth.mm = ((po2_limit.mbar * 1000 / get_o2(mix) * 10 - 10000) / > >>> roundto) * roundto; > >>> return depth; > >>> } > >>> > >>> So all we need to do is adjust this function to add (roundto - 1) to the > >>> enumerator before deviding by roundto, correct? > >> > >> Ugh. I think it would be better to write it more readably first. > >> That's a particularly unreadable line of noise. > > > > Well, Robert wrote it, now he can fix it. > > I couldn’t remember but git blame says so. But I only added the rounding, the > poor man’s pressure to depth conversion was there before.
I abstracted it out to a separate helper, but you wrote the math to begin with back in 9ddef367 =) //Anton -- Anton Lundin +46702-161604 _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
