summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug2022.sci
blob: 9f693c019a80130d4f09149b2b3903944c19f7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// <-- Non-regression test for bug 2022 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2022
//
// <-- Short Description -->
//    percentile function (perctl) doesn't always calculate percentile value, instead
//    choosing to error out:
//
//    Example that causes error:
//
//    perctl([23.4,364.34,1929.3,4234.3,293.3,928.3],[10])

// Author : Scilab Project - Pierre MARECHAL
// Copyright INRIA
// Date : 12 june 2006

test1 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],90) == [472 3] );
test2 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],75) == [452 6] );
test3 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],10) == [368 22] );
test4 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],1) == [332 23] );
test5 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],2) == [332 23] );
test6 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],99) == [500 1] );

test7 = ( perctl([23.4,364.34,1929.3,4234.3,293.3,928.3],[10]) == [23.4 1] );

if and(test1) & and(test2) & and(test3) & and(test4) & and(test5) & and(test6) & and(test7) then
	affich_result(%T,2022);
else
	affich_result(%F,2022);
end