Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

real

real is a module that provides functions for operating on reals.

Functions


abs: real -> real

Returns the absolute value of the passed real.

Example

<span class='hljs-keyword'>let</span> fourpointfive = <span class='hljs-title class_'>real</span><span class='hljs-punctuation'>::</span>abs <span class='hljs-operator'>-</span><span class='hljs-variable constant_'>4.5</span>
<span class='hljs-keyword'>let</span> alsofourpointfive = <span class='hljs-title class_'>real</span><span class='hljs-punctuation'>::</span><span class='hljs-title function_'>abs</span> <span class='hljs-variable constant_'>4.5</span>

truncate: real -> real

Truncates the passed real by removing the decimal component.

Example

<span class='hljs-keyword'>let</span> four = <span class='hljs-title class_'>real</span><span class='hljs-punctuation'>::</span><span class='hljs-title function_'>truncate</span> <span class='hljs-variable constant_'>4.5</span>