UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor tmc
Visitor
254 Views
Registered: ‎01-11-2019

Xilinx UltraScale Floating Point Exceptions

Can the floating Point Exceptions on the Xilinx Ultrascale be masked or disabled and a default result be obtains? Such as a divide by zero would result in +/- infinity.

0 Kudos
1 Reply
Voyager
Voyager
251 Views
Registered: ‎08-16-2018

Re: Xilinx UltraScale Floating Point Exceptions

And how is infinity represented?

Most math exceptions are filtered out at source (divisions by zero, log of zero or negative) as you gain nothing by carrying on with NaN values. In my opinion, better to stop at that point and fix it.

What might work for you is capping the values, like whenever you are dividing by zero, assigning a result of 1e30 or whatever big value huge enough to be 'infinity' yet small enough to fit into your floats/ doubles, etc. That may look like a dodgy trick but is surprisingly useful. The only condition to meet is making sure your 'normal' values don't reach that level. 

If you want a 'pure' infinity representation, then I think NaN is not native in C. In that case you will have to create a super set of numbers including all representable real values plus nan. That implies redefining all your math operations, including log, sin, etc. A lot of hassle.

 

EDIT: it looks like NaN is representable in GNU C.

Also, NaN is different from infinity. A complex number is nan in real-valued functions. Having problems only with infinity is less of a problem.

0 Kudos