But quality of work can be expected only through personal satisfaction, dedication and enjoyment. In our profession, precision and perfection are not a dispensible luxury, but a simple necessity.-Niklaus Wirth
You may know that in alpha-1 and 2 you can use the str subroutine to cast from an integer to a string. For example:
?number =~ "PI = ";Output:
number = 3,141592654;
!out(~number, ~!str(number));
PI = 3,141592654In alpha-3 str also accepts a 3th, optional argument. Notice that the above example would produce the following output in alpha-3:
PI = 3
This 3th argument is the decimal precision, and it's default value is 0. The following:
?number =~ "PI = ";Will thus produce:
number = 3,141592654;
!out(~number, ~!str(number, 10));
PI = 3,1415926540
No comments:
Post a Comment