Closed R0mb0 closed 2 years ago
Sprry, but currently, there is no way to control how the top-level displays floating numbers.
Don't know if it helps but you can add a call to format/2
in your goal to display your float with a given number of decimals, e.g.:
| ?- X is 0.77/10, format('~3f',[X]).
0.077
X = 0.076999999999999999
If you don't want to see the X = 0.076999999999999999 shown by the top-level you can use a variable name beginning with underscore (such variables are not shown):
| ?- _X is 0.77/10, format('~3f',[_X]).
0.077
Thanks for your clarification!
System info:
Reproduction:
Question:
Is there a way to select the desired number of decimal places in the resulting expr ?