How dose "Is Finite" VOP work

   728   4   1
User Avatar
Member
86 posts
Joined: Feb. 2019
Offline
How dose Is Finite VOP work?
What is the meaning for "infinite numbers or NANs"?

Attachments:
G$_RPH`{$KTLJ4V@PXZ)LXJ.png (17.1 KB)

User Avatar
Member
67 posts
Joined: Oct. 2018
Offline
a NaN is Not a Number.
And infinity is that "8" that's laying lazy on its belly...

if you continue the series 1/x where x gets closer to zero like
for (float i=1.0;i>0;i=i/10.0) print(1/x)You'll get 1, 10,100,100,... 1e10 (meaning a 11 figure number) and eventually it will stop/throw with a +Inf for Infinity as a convention in math 1/0 is set as +Inf (Not 100% sure here, anybody??)
even better: Try this in your python shell
i=1
while i>0:
   print(i, 1.0/i)
   i=i/10.0

a NaN is a number that is not defined at all. Like Inf-Inf=NaN.
But Inf+Inf=Inf


Then in math you have (in growing order)
  • Natural numbers like 1,2,3,4,5,... (There is some times a fighting if 0 (zero) belongs to the Naturals or not)
  • Integers ...,-3,-2,-1,0,1,2,3,...
  • Rational Numbers a/b where a and b are both integers (examples )1/1,1/2,1/3,-2/-1,2/-2,-2/3
  • Real Numbers where the "rest" of numbers lives, like PI(3.14159....), e(2.718281828459045...)
  • Complex numbers a+b*i , where i=sqrt(-1) ( Also called imaginary when a=0 )

and then there come vectors, matrices, and tensors... Don't ask ! Calculus !!

pi and i run into each other at a cross roads. i shouts at pi: "Get rational!!!" pi responds: "Get Real!!!" (Yes, I am one of those....)
and then ... where epsilon<0 ...
Have a nice day !!
Edited by GOgraphR - May 12, 2023 00:36:25
User Avatar
Member
8597 posts
Joined: July 2007
Offline
within Houdini there can occasionally happen that you'll get Inf or NaN values typically on your geo or images after some SOP or COP operator, which can then cause errors in subsequent operators
those will literally show as NaN, Inf or -Inf in the Grometry spreadsheet or color info picker

so Is Finite, Is NAN VOP as well as isfinite(), isnan() VEX function allow you to detect these and potentially replace or process them

that being said, most of the operators have internal guardrails or in case of VEX some illegal operations have fallback values for such cases, like x/0 may return 0 instead of Inf or NaN
so if you notice any of the operators producing such values you should report a bug
Edited by tamte - May 12, 2023 01:27:31
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
86 posts
Joined: Feb. 2019
Offline
GOgraphR
a NaN is Not a Number.
And infinity is that "8" that's laying lazy on its belly...

if you continue the series 1/x where x gets closer to zero like
for (float i=1.0;i>0;i=i/10.0) print(1/x)You'll get 1, 10,100,100,... 1e10 (meaning a 11 figure number) and eventually it will stop/throw with a +Inf for Infinity as a convention in math 1/0 is set as +Inf (Not 100% sure here, anybody??)
even better: Try this in your python shell
i=1
while i>0:
   print(i, 1.0/i)
   i=i/10.0

a NaN is a number that is not defined at all. Like Inf-Inf=NaN.
But Inf+Inf=Inf


Then in math you have (in growing order)
  • Natural numbers like 1,2,3,4,5,... (There is some times a fighting if 0 (zero) belongs to the Naturals or not)
  • Integers ...,-3,-2,-1,0,1,2,3,...
  • Rational Numbers a/b where a and b are both integers (examples )1/1,1/2,1/3,-2/-1,2/-2,-2/3
  • Real Numbers where the "rest" of numbers lives, like PI(3.14159....), e(2.718281828459045...)
  • Complex numbers a+b*i , where i=sqrt(-1) ( Also called imaginary when a=0 )

and then there come vectors, matrices, and tensors... Don't ask ! Calculus !!

pi and i run into each other at a cross roads. i shouts at pi: "Get rational!!!" pi responds: "Get Real!!!" (Yes, I am one of those....)
and then ... where epsilon<0 ...
Have a nice day !!

Thank your for your detailed reply
User Avatar
Member
86 posts
Joined: Feb. 2019
Offline
tamte
within Houdini there can occasionally happen that you'll get Inf or NaN values typically on your geo or images after some SOP or COP operator, which can then cause errors in subsequent operators
those will literally show as NaN, Inf or -Inf in the Grometry spreadsheet or color info picker

so Is Finite, Is NAN VOP as well as isfinite(), isnan() VEX function allow you to detect these and potentially replace or process them

that being said, most of the operators have internal guardrails or in case of VEX some illegal operations have fallback values for such cases, like x/0 may return 0 instead of Inf or NaN
so if you notice any of the operators producing such values you should report a bug

Thank your for your detailed reply
  • Quick Links