Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
13
Task/Averages-Median/FutureBasic/averages-median.basic
Normal file
13
Task/Averages-Median/FutureBasic/averages-median.basic
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
local fn MedianAverage( arguments as CFArrayRef ) as CFStringRef
|
||||
ExpressionRef expRef = fn ExpressionForFunction( @"median:", @[fn ExpressionForConstantValue( arguments )] )
|
||||
CFNumberRef result = fn ExpressionValueWithObject( expRef, NULL, NULL )
|
||||
CFStringRef median = fn NumberStringValue( result )
|
||||
end fn = median
|
||||
|
||||
print fn MedianAverage( @[@1, @9, @2] ) // 2
|
||||
print fn MedianAverage( @[@1, @9, @2, @4] ) // 3
|
||||
print fn MedianAverage( @[@5.961475, @2.025856, @7.262835, @1.814272, @2.281911, @4.854716] ) // 3.5683135
|
||||
print fn MedianAverage( @[@4.1, @5.6, @7.2, @1.7, @9.3, @4.4, @3.2] ) // 4.4
|
||||
print fn MedianAverage( @[@40.12, @860.77, @960.29, @920.13] ) // 890.45
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue