statistics utilities #281
Aliases: statistics utilities, stats utils, stu
2 verbs · 11 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
median | this none this | rxd | #281 | 12 |
median_suspended | this none this | rxd | #281 | 12 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
help_msg | #72 | rc | #361 | list of 6{"$stats_utils ($stu) provides verbs for statistical analysis.", "", "or it will, someday. currently there is one verb:", " :median(LIST) -> FLOAT median.", "", "It is also available in suspending form as :median_suspended."} |
aliases | #1 | rc | #361 | {"statistics utilities", "stats utils", "stu"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {1709, 1298434487} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #72 Generic Utilities Package → #1 root
Children: none
Call graph
Source
median
Referenced by
none
Source
1":median(LIST floats_or_ints) => FLOAT median"; 2{l} = args; 3if (typeof(l) != LIST) 4raise(E_INVARG, "argument 1 must be list"); 5endif 6l = $lu:sort(l); 7n = length(l); 8if ((n % 2) == 0) 9return (tofloat(l[(n / 2) + 1]) + tofloat(l[n / 2])) / 2.0; 10else 11return tofloat(l[(n / 2) + 1]); 12endif
median_suspended
Referenced by
none
Source
1":median(LIST floats_or_ints) => FLOAT median"; 2{l} = args; 3if (typeof(l) != LIST) 4raise(E_INVARG, "argument 1 must be list"); 5endif 6l = $lu:sort_suspended(l); 7n = length(l); 8if ((n % 2) == 0) 9return (tofloat(l[(n / 2) + 1]) + tofloat(l[n / 2])) / 2.0; 10else 11return tofloat(l[(n / 2) + 1]); 12endif