[Virtual-sensor] the issue of exprtk lib.

Thu Nguyen thu at amperemail.onmicrosoft.com
Fri May 7 09:05:59 AEST 2021


Dear,

I'm supporting the virtual sensor using phosphor-virtual-sensor.

The expression of sensor e is max(t,x,y,z). When t is nan, the value of 
e will always is nan.

I tried to verify the exprtk lib and see this is the issue of lib. 
Please see below test:

/exprtk$ ./exprtk_simple_example_01
max(x,y,z,t) of  x:37.000000, y:63.000000, z:13.000000, t:nan is 63.000000
max(t,x,y,z) of  x:37.000000, y:63.000000, z:13.000000, t:nan is nan

exprtk$ ./exprtk_simple_example_01
max(x,y,z,t) of  x:82.000000, y:34.000000, z:92.000000, t:nan is 92.000000
max(t,x,y,z) of  x:82.000000, y:34.000000, z:92.000000, t:nan is nan

./exprtk_simple_example_01
max(x,y,z,t) of  x:29.000000, y:76.000000, z:61.000000, t:nan is 76.000000
max(t,x,y,z) of  x:29.000000, y:76.000000, z:61.000000, t:nan is nan

Regards.

Thu Nguyen.



More information about the openbmc mailing list