[Cfp-interest 2502] Re: encode*() and invalid DFP data

Jim Thomas jaswthomas at sbcglobal.net
Thu Aug 4 12:10:40 PDT 2022


There aren’t any invalid bit patterns in decimal floating types (except possibly for decimal extended floating types and leaving those as undefined behavior seems appropriate).

- Jim Thomas

> On Aug 4, 2022, at 9:46 AM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> What are the encode*() functions [7.12.16.*] supposed to do with
> invalid DFP data?  
> Undefined behaviour?
> Treat them as NaN?
> 
> I assume that there are bit patterns that are invalid DFP.
> 
> Would it be better to have those functions return an int to 
> indicate success or invalid data?
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
> 
> _______________________________________________
> 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