From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: rodrigo.alencar@analog.com
Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH RFC 2/3] lib: test-kstrtox: add E notation tests for kstrto[u]dec64()
Date: Thu, 1 Oct 2026 22:20:48 +0300 [thread overview]
Message-ID: <ar6ykJxQBAN9OrRS@ashevche-desk.local> (raw)
In-Reply-To: <20261001-e-notation-v1-2-75187bf06c10@analog.com>
On Thu, Oct 01, 2026 at 12:34:57PM -0300, Rodrigo Alencar via B4 Relay wrote:
> Cover E notation parsing in kstrtoudec64() and kstrtodec64(): positive,
> zero and negative exponents, upper case 'E', an explicit '+' sign,
> truncation of integer digits by negative exponents, large values, and
> failures for overflowing or incomplete exponents.
...
> {"0.2", 20},
> {"0.18446744073709551616", 20},
> {"1", 20},
> + /* E notation: exponent causes overflow */
> + {"1e21", 1},
> + {"2e20", 1},
> + /* E notation: no digits after exponent marker */
> + {"1e", 3},
> + /* E notation: sign only after exponent marker */
> + {"1e+", 3},
> + {"1e-", 3},
I would also consider something like
1ee // double 'e'
1e+0b // an attempt to have a hexadecimal exponent
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-10-01 19:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 15:34 [PATCH RFC 0/3] Add E notation support to kstrtodec64() and IIO sysfs writes Rodrigo Alencar via B4 Relay
2026-10-01 15:34 ` [PATCH RFC 1/3] lib: kstrtox: support E notation in kstrtoudec64() and kstrtodec64() Rodrigo Alencar via B4 Relay
2026-10-01 15:34 ` [PATCH RFC 2/3] lib: test-kstrtox: add E notation tests for kstrto[u]dec64() Rodrigo Alencar via B4 Relay
2026-10-01 19:20 ` Andy Shevchenko [this message]
2026-10-01 15:34 ` [PATCH RFC 3/3] iio: core: use kstrtodec64() to parse fixed-point values Rodrigo Alencar via B4 Relay
2026-10-01 19:29 ` Andy Shevchenko
2026-10-02 9:28 ` Rodrigo Alencar
2026-10-02 8:00 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ar6ykJxQBAN9OrRS@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.alencar@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®