1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: stream protocol question: ASCII hex to 32-bit float |
From: | Eric Norum <[email protected]> |
To: | Kevin Peterson <[email protected]> |
Cc: | EPICS tech talk <[email protected]> |
Date: | Thu, 10 Mar 2016 09:03:41 -0800 |
If you don’t need to worry about NaNs or Infinities I think that this calc record will do what you need: record(calc, "floatMap") { field(A, "0x3F800000") field(CALC, "B:=A?((A&0x7FFFFF)+0x800000)*2**(((A>>23)&255)-150):0;A&0x80000000?-B:B") }
--
Eric Norum [email protected] |