[Toybox] [PATCH] Fix various seq bugs.

enh enh at google.com
Sat May 13 12:49:28 PDT 2017


i wasn't seriously considering implementing the arbitrary-precision
arithmetic that GNU seems to use, but i did wonder about at least
using long long instead of double for 53<bits<64 integers before
deciding i was already far enough down the rat hole...

(on Android, where we already link against boringssl for the assembler
hash functions, we could easily use the assembler bignum functions
too, but both of us have better things to do!)

the specific bug report was bad behavior around 1000000 because of %g.
increasing that to 53 bits should be enough for anyone... :-)

On Sat, May 13, 2017 at 12:36 PM, enh <enh at google.com> wrote:
> Use the precision of the inputs to determine the default output. This was the
> reported bug. (Two existing tests were failing on the host because of this,
> so I've fixed those tests and added more tests for other special cases.)
>
> Reject invalid inputs.
>
> Match GNU/busybox behavior with 0 increment. (An existing test was failing on
> the host because of this.)
>
> Also remove a couple of locals that were duplicating globals.
>
> Bug: http://b/37792952
> ---
>  tests/seq.test | 23 +++++++++++++++---
>  toys/lsb/seq.c | 74 ++++++++++++++++++++++++++++++++++++++--------------------
>  2 files changed, 69 insertions(+), 28 deletions(-)



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list