note 110450 modified in language.types.float by danbrown
| From: | danbrown@php.net | Date: | Thu, 06 Dec 2012 14:31:28 +0000 |
| Subject: | note 110450 modified in language.types.float by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192340@lists.php.net to get a copy of this message | ||
To simply convert 32 bits float from hex to float:
<?php
function hexfloat ($hex){
return (unpack("f", pack('H*',$hex))[1]);
}
?>
This may be useful for arduino interface with php.
--was--
To simply convert 32 bits float from hex to float:
function hexfloat ($hex){
return (unpack("f", pack('H*',$hex))[1]);
}
This may be useful for arduino interface with php.
http://php.net/manual/en/language.types.float.php