Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,29 @@
// Trabb Pardo-Knuth algorithm
include "NSLog.incl"
local fn f( x as double ) as double
end fn = fn pow( abs(x), 0.5) + 5 * ( fn pow(x, 3) )
void local fn PardoKnuth( userInput as double )
double x = userInput
double y = fn f(x)
NSLog( @"f(%.4f)\t= \b", x )
if( y < 400.0 )
NSLog( @"%.4f", y )
else
NSLog( @"[Overflow]" )
end if
end fn
NSUInteger i
CFArrayRef numbers
numbers = @[@10, @-1, @1, @2, @3 ,@4, @4.3, @4.305, @4.303, @4.302, @4.301]
NSLog( @"Please enter 11 numbers:" )
for i = len(numbers) to 1 step -1
fn PardoKnuth( fn NumberDoubleValue( numbers[i-1] ) )
next
HandleEvents