Forum Discussion
Altera_Forum
Honored Contributor
17 years agoTaking a more real scenario, lets say I want to make a LUT of fixed-point values representing 1/sqrt(x). Finding sqrt(x) is as easy as raising x^0.5. Raising x^0.5 is done by using exp(0.5 * ln(x)) - each of which should not lose precision by truncating and rounding for every return.
In the end, while the code you provided does work for trivial cases (which I had asked about), once the LUT gets a little more complicated, it all seems to fall apart. The conclusion is that Quartus II does not support functions that return real types, even if they are only evaluated at compile time, which is a shame.