This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** This is a submodule of $(MREF std, math). | |
| It contains several functions for rounding floating point numbers. | |
| Copyright: Copyright The D Language Foundation 2000 - 2011. | |
| D implementations of floor, ceil, and lrint functions are based on the CEPHES math library, which is Copyright (C) 2001 Stephen L. Moshier | |
| $(LT)steve@moshier.net$(GT) and are incorporated herein by permission of the author. The author reserves the right to distribute this | |
| material elsewhere under different copying permissions. These modifications are distributed here under the following terms: | |
| License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(HTTP digitalmars.com, Walter Bright), Don Clugston, | |
| Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger Source: $(PHOBOSSRC std/math/rounding.d) | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function benchmark(func, ...) | |
| func(...) | |
| local start = os.clock() | |
| local result = func(...) | |
| local elapsed = os.clock() - start | |
| print(string.format("Time: %.3f ms", elapsed * 1000)) | |
| end | |