You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so apparently isinf is implemented using a macro in this case. To avoid this kind of line noise, it might be a good idea to add specialized floating point asserts like:
Right. This is a good suggestion. One would wish it was possible to get at the non-preprocessed source, but I assume that is not possible. Or at least not in a portable fashion.
Todo:
Create list of asserts (is the suggested list sufficient?)
Judging from these docs, it looks like C99 introduced a number of "comparison and classification" functions. Of these, isfinite, isinf, isnan, and isnormal are the most important. Already covered are isgreater, isgreaterequal, isless, and islessequal (I guess these must have been added to the standard to provide predefined predicates for sorting functions). Not sure what the use case for islessgreater, but I could look into this at some point. That leaves signbit (whether floating point number is negative), and isunordered (whether one or both numbers is NAN). These last two could be good special purpose asserts. But when I get a chance to look at this I will start with the first four.
We could implement them one by one, we don't have to batch them together in implementation. But probably should have all implemented when we release a version with them officially supported though.
I have a test that looks like:
When this test fails, I get something like this on macOS using Clang 12 installed with MacPorts:
so apparently isinf is implemented using a macro in this case. To avoid this kind of line noise, it might be a good idea to add specialized floating point asserts like:
etc., with output along the lines of:
The text was updated successfully, but these errors were encountered: