Path: ...!feeds.phibee-telecom.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.c Subject: Re: The difference between strtol() and strtoul() ? Date: Mon, 24 Jun 2024 02:31:11 -0000 (UTC) Organization: A noiseless patient Spider Lines: 14 Message-ID: <20240623192959.369@kylheku.com> References: <20240621182839.00000dc4@yahoo.com> <20240621185314.00004fda@yahoo.com> <87o77uqktg.fsf@bsb.me.uk> <20240623121952.00005fa9@yahoo.com> <87r0cnq46s.fsf@bsb.me.uk> <20240623153219.000009b0@yahoo.com> <87jzifpth6.fsf@bsb.me.uk> <864j9jh77d.fsf@linuxsc.com> <87r0cntga9.fsf@nosuchdomain.example.com> <87o77rnrt2.fsf@bsb.me.uk> <20240623191452.334@kylheku.com> Injection-Date: Mon, 24 Jun 2024 04:31:11 +0200 (CEST) Injection-Info: dont-email.me; posting-host="0a91c74ce60a0e44ab75e91b4c3a6a2f"; logging-data="783840"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Oxb8IM0vIN4Pleu5hlM2CX8WuiNCoGNs=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:jJ9hnKML4g947PImPrCZe+xjMoY= Bytes: 1912 On 2024-06-24, Kaz Kylheku <643-408-1753@kylheku.com> wrote: > If the negation, which is a positive value, cannot be represented in the > type, that implies it is out of range. The required behavior for a > positive out-of-range value is to return LLONG_MAX and set errno to > ERANGE. Errr, what am I saying! The negation, which is a negative value, cannot be represented in the type, so the required behavior is to return LLONG_MIN and set errno to negative. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca