hello: Is there any way that if a calculation gives me infinite as a result, it returns a 0?
I tried something like
and try that instead of infinity I get 0 with IF out := "Infinity" THEN out := 0 END_IF
but logically recognizes it as a string and it does not work, is there a way to do what I want?
best regards
Hi.
I think that in oscat there are a function which test if an real is infinite.
If not, search in wikipedia how an float number is bit coded. After read the float as ulint, there are a bit which mark the number as infinite.
thankss
CHK_REAL in oscat.basic
Log in to post a comment.
hello:
Is there any way that if a calculation gives me infinite as a result, it returns a 0?
I tried something like
and try that instead of infinity I get 0 with
IF out := "Infinity" THEN
out := 0
END_IF
but logically recognizes it as a string and it does not work, is there a way to do what I want?
best regards
Hi.
I think that in oscat there are a function which test if an real is infinite.
If not, search in wikipedia how an float number is bit coded. After read the float as ulint, there are a bit which mark the number as infinite.
thankss
CHK_REAL in oscat.basic