Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
math:start [2025/09/22 22:30] – [Functions] rajitmath:start [2025/09/23 11:02] (current) – [Fixed point data type] rajit
Line 37: Line 37:
 } }
 </code> </code>
 +Other ways to initialize ''x'' to the fixed point number corresponding to the integer representation ''0x0f'' (which corresponds to 1.875 for Q(8,3)) are:
 +<code act>
 +...
 +chp {
 +   x.x := 0x0f;
 +   ...
 +   x.set(0x0f);
 +   ...
 +}
 +</code>
 +
 For debugging purposes, two macros are also provided for displaying the value of a fixed point number. The ''log()'' macro just displays the number using the ''log()'' statement, while the ''log_p()'' displays it without a new line. For debugging purposes, two macros are also provided for displaying the value of a fixed point number. The ''log()'' macro just displays the number using the ''log()'' statement, while the ''log_p()'' displays it without a new line.
 <code act> <code act>