Pregunta

HP-UX's libc has the function fesetflushtozero to switch floating-point behavior between “gradual underflow” and “flush to zero”. How to achieve the same thing on a system running glibc?

¿Fue útil?

Solución

There is no mention of support for this in the glibc manual. It is not a standard IEEE-754 feature and does not exist on all processors, even those with hardware support for floating-point.

Some processors suffer a performance deficiency when operating on subnormal numbers. Flush-to-zero is a deviation from IEEE 754 that provides a work-around for this. It should generally be avoided, and manufacturers should be asked to provide good performance while conforming to the standard.

If you must use it, you will need target-specific methods of doing so, likely with assembly code or special routines provided by a vendor.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top