Error: cannot take ceil() of Nan

7 views
Skip to first unread message

Ramesh Kumar

unread,
Feb 18, 2022, 8:40:09 AMFeb 18
to PRISM model checker
For the following PRISM code:

csg

global R1:[11..50] init 30;
formula R1_drift_down2=ceil (min (pow(R1*R1-100,0.5), 50));
R1'= R1_drift_down2 // for certain conditions

I am getting the Error: cannot take ceil() of Nan: NaN is non-finite, cannot be represented by int

Anyway to resolve this?
Thank you.

Ramesh





Dave Parker

unread,
Apr 1, 2022, 3:35:09 AMApr 1
to prismmod...@googlegroups.com, Ramesh Kumar
Hi Ramesh,

Your pow(...) expression is taking the square root of R1^2-100. In
places where R1^2-100 is negative, I guess this will result in NaN,
causing the error you saw.

Best wishes,

Dave
> --
> You received this message because you are subscribed to the Google
> Groups "PRISM model checker" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to prismmodelchec...@googlegroups.com
> <mailto:prismmodelchec...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/prismmodelchecker/45b8c174-eec9-4965-8664-dc58ee51c1dfn%40googlegroups.com
> <https://groups.google.com/d/msgid/prismmodelchecker/45b8c174-eec9-4965-8664-dc58ee51c1dfn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages