Benford's law: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) |
(→{{header|ALGOL 68}}: Avoid line-wrap) |
||
Line 376: | Line 376: | ||
PROC compare to benford = ( []REAL actual )VOID: |
PROC compare to benford = ( []REAL actual )VOID: |
||
FOR i TO 9 DO |
FOR i TO 9 DO |
||
print( ( "Benford: ", fixed( log( 1 + ( 1 / i ) ), -7, 3 |
print( ( "Benford: ", fixed( log( 1 + ( 1 / i ) ), -7, 3 ) |
||
, " actual: ", fixed( actual[ i ], -7, 3 ) |
|||
, newline |
|||
) |
|||
) |
|||
OD # compare to benford # ; |
OD # compare to benford # ; |
||
# generate 1000 fibonacci numbers # |
# generate 1000 fibonacci numbers # |
||
Line 399: | Line 403: | ||
Benford: 0.046 actual: 0.045 |
Benford: 0.046 actual: 0.045 |
||
</pre> |
</pre> |
||
=={{header|Arturo}}== |
=={{header|Arturo}}== |
||