[Cfp-interest 2676] Re: floating constants issue

Jim Thomas jaswthomas at sbcglobal.net
Wed Feb 1 09:06:35 PST 2023



> On Feb 1, 2023, at 4:59 AM, Vincent Lefevre <vincent at vinc17.net> wrote:
> 
> On 2023-01-31 17:28:04 -0800, Jim Thomas wrote:
>> Here’s a draft for changes to clarify that FE_DYNAMIC does not
>> establish a constant rounding mode:
>> 
>> https://wiki.edg.com/pub/CFP/WebHome/Floating_constants_issue-20230131.pdf
> 
> Thanks.
> 
> In this draft, "constant rounding more": "change "more" to "mode".

Yes
> 
> There's also an issue in NOTE 1: this will not work for constants
> ("Floating constants (6.4.4.2) of a standard floating type that
> occur in the scope of a constant rounding mode shall be interpreted
> according to that mode.").

Good catch. This will take some thought.
> 
> BTW, this rule for constants is unintuitive, thus error-prone, when
> using non-symmetric rounding, because negative constants do not exist,
> so that when writing "-0.1", the negation is done after rounding.
> I don't know whether this has already been discussed and what could be
> done. If the rule is kept as is, there should be at least an example
> to warn about this issue.

See 

6.4.4.3 #12
7.24.1.5 #4 footnote 355
7.24.1.6 #4
 
Unfortunately, there’s existing practice for strtod doing the negation before and after the negation.

- Jim Thomas
> 
> -- 
> Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list