source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/NaNandInf.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 590 bytes
Line 
1function pass = NaNandInf
2
3% Rodrigo Platte
4
5% If an evaluation returns NaN or Inf, the constructro should give an error
6% message!
7
8splitting off
9% NaN
10pass1 = false;
11try
12    chebfun(@(x) x.^6.*sin(1./x.^2),[-1 1]);
13catch
14    pass1 = true;
15end
16
17% Inf
18pass2 = false;
19try
20    chebfun(@(x) log(x+1));
21catch
22    pass2 = true;
23end
24
25splitting on
26
27% NaN
28pass3 = false;
29try
30    chebfun(@(x) x.^6.*sin(1./x.^2),[-1 1]);
31catch
32    pass3 = true;
33end
34
35% Inf
36pass4 = false;
37try
38    chebfun(@(x) log(x+1));
39catch
40    pass4 = true;
41end
42
43
44pass = pass1 && pass2 && pass3 && pass4;
45
46chebfunpref factory;
Note: See TracBrowser for help on using the repository browser.