Re:Optimizations Enabled by -ffast-Math
by stncls on Wednesday October 20, 2021 @08:33AM
(#28929887)
An example use of Inf is bounds on a value. Say you want to express that x sometimes has upper and/or lower bounds. With Inf you can simply write
accepting that l is sometimes -Inf and u is sometimes +Inf. Without Inf, you get four different cases to handle. This is particularly handy when operations get slightly more complex, like transforming
into the canonical form above, for some finite b. With Inf you can simply write
and things will work as one expects. Again, without Inf, multiple cases to handle correctly.
[ Parent
| on HN ]
There are no comments on this comment yet.