|
hbghlyj
Posted at 2023-5-10 05:01:16
asin(1.000001) = nan🙂
> unitsize(1cm)
> real f(real x){return asin(x);}
> import graph
> draw(graph(f,0,0.5))
成功
> draw(graph(f,0,0.9));
成功
> draw(graph(f,0,1.));
成功 因为$\text{asin}(1)=π/2$
> draw(graph(f,0,1.000001));
Error: /typecheck in /--EPSBoundingBoxCrop--
Operand stack:
--nostringval-- (%%BoundingBox: -nan nan nan -nan) --dict:1/2(ro)(G)-- --nostringval-- --nostringval-- (%%BoundingBox: -nan nan nan -nan) 1 -nan nan -nan nan -nan
Execution stack:
%interp_exit .runexec2 --nostringval-- EPSBoundingBoxCrop --nostringval-- 2 %stopped_push --nostringval-- EPSBoundingBoxCrop EPSBoundingBoxCrop false 1 %stopped_push 1990 1 3 %oparray_pop 1989 1 3 %oparray_pop 1988 1 3 %oparray_pop EPSBoundingBoxCrop 1977 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- EPSBoundingBoxCrop --nostringval-- 2 %stopped_push --nostringval-- %ztokenexec_continue (scanner state) EPSBoundingBoxCrop EPSBoundingBoxCrop EPSBoundingBoxCrop EPSBoundingBoxCrop 1986 8 3 %oparray_pop EPSBoundingBoxCrop 1984 11 3 %oparray_pop EPSBoundingBoxCrop
Dictionary stack:
--dict:761/1123(ro)(G)-- --dict:0/20(G)-- --dict:79/200(L)--
Current allocation mode is local
Current file position is 57
GPL Ghostscript 9.54.0: Unrecoverable error, exit code 1
_shipout(prefix,f,currentpatterns,format,wait,view,t);
^
C:\Program Files\Asymptote/plain_shipout.asy: 116.11: runtime: shipout failed
奇怪的是,Asymptote并没有抛出浮点数异常,而是正常输出了一个eps文件,但是这个eps文件的bounding box值为nan,所以ghostscript会抛出错误。 |
|