Re: [Qemu-devel] [PATCH v1 1/9] cutils: add qemu_strtod() and qemu_strtod_finite()

2018-11-15 Thread David Hildenbrand
On 15.11.18 19:02, Eric Blake wrote: > If the conversion underflows, store ±0.0 in @result, depending on the > sign, and return -ERANGE. Will do! Thanks! -- Thanks, David / dhildenb

Re: [Qemu-devel] [PATCH v1 1/9] cutils: add qemu_strtod() and qemu_strtod_finite()

2018-11-15 Thread Eric Blake
On 11/15/18 11:25 AM, David Hildenbrand wrote: Also, just overflow. Floating-point underflow is when a computation's mathematical result is too close to zero to be represented without extraordinary rounding error. works like qemu_strtoul(). I'd prefer longhand for qemu_strtod(). It costs

Re: [Qemu-devel] [PATCH v1 1/9] cutils: add qemu_strtod() and qemu_strtod_finite()

2018-11-15 Thread David Hildenbrand
On 15.11.18 17:22, Markus Armbruster wrote: > Eric Blake writes: > >> On 11/15/18 8:04 AM, David Hildenbrand wrote: >>> Let's provide a wrapper for strtod(). >>> >>> Signed-off-by: David Hildenbrand >>> --- >>> include/qemu/cutils.h | 2 ++ >>> util/cutils.c | 38

Re: [Qemu-devel] [PATCH v1 1/9] cutils: add qemu_strtod() and qemu_strtod_finite()

2018-11-15 Thread Markus Armbruster
Eric Blake writes: > On 11/15/18 8:04 AM, David Hildenbrand wrote: >> Let's provide a wrapper for strtod(). >> >> Signed-off-by: David Hildenbrand >> --- >> include/qemu/cutils.h | 2 ++ >> util/cutils.c | 38 ++ >> 2 files changed, 40 insertions(

Re: [Qemu-devel] [PATCH v1 1/9] cutils: add qemu_strtod() and qemu_strtod_finite()

2018-11-15 Thread Eric Blake
On 11/15/18 8:04 AM, David Hildenbrand wrote: Let's provide a wrapper for strtod(). Signed-off-by: David Hildenbrand --- include/qemu/cutils.h | 2 ++ util/cutils.c | 38 ++ 2 files changed, 40 insertions(+) + +/** + * Convert string @nptr t

[Qemu-devel] [PATCH v1 1/9] cutils: add qemu_strtod() and qemu_strtod_finite()

2018-11-15 Thread David Hildenbrand
Let's provide a wrapper for strtod(). Signed-off-by: David Hildenbrand --- include/qemu/cutils.h | 2 ++ util/cutils.c | 38 ++ 2 files changed, 40 insertions(+) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 7071bfe2d4..756b41c193