mastercoin-MSC/mastercore — pull request #183 by dexX7 (2014-10-23 08:37:40+00:00)
Title: Move rounduint64, swapByteOrderN, test and "fix" rounduint64

- rounduint64 fixed (imho)
- rounduint64 and swapByteOrderN are available via mastercore_convert.h
- both are in the namespace mastercore

Regarding the downsides of (old) rounduint64 see #178. Most significantly: it doesn't clip anymore and numbers >= 2147483648.0 are accepted. Negative numbers have a similar behavior like positive numbers, whereby this wasn't used at all until now:

```c++
rounduint64(-0.00000000) = rounduint64(0.00000000) = 0
rounduint64(-1.00000000) = rounduint64(1.00000000) = 1
rounduint64(-2.00000000) = rounduint64(2.00000000) = 2
rounduint64(-3.00000000) = rounduint64(3.00000000) = 3

rounduint64(-0.49999999) = rounduint64(0.49999999) = 0
rounduint64(-1.49999999) = rounduint64(1.49999999) = 1
rounduint64(-2.49999999) = rounduint64(2.49999999) = 2
rounduint64(-3.49999999) = rounduint64(3.49999999) = 3

rounduint64(-0.50000000) = rounduint64(0.50000000) = 1
rounduint64(-1.50000000) = rounduint64(1.50000000) = 2
rounduint64(-2.50000000) = rounduint64(2.50000000) = 3
rounduint64(-3.50000000) = rounduint64(3.50000000) = 4

rounduint64(-0.50000001) = rounduint64(0.50000001) = 1
rounduint64(-1.50000001) = rounduint64(1.50000001) = 2
rounduint64(-2.50000001) = rounduint64(2.50000001) = 3
rounduint64(-3.50000001) = rounduint64(3.50000001) = 4
```