No BSD License  

Highlights from
Int2Hex

Be the first to rate this file! 1 Download (last 30 days) File Size: 689 Bytes File ID: #21336

Int2Hex

by Kobi Kai Calev

 

04 Sep 2008 (Updated 04 Sep 2008)

wrapper for dec2hex, to handle 64bit + signed numbers via typecast

| Watch this File

File Information
Description

[sorry - uploaded wrong version, this one runs...]

Matlab's dec2hex (which converts 'integers' to hex, donno why 'dec' in mentioned), rejects all unsigned types, and 'int64'.
And that's the perpuse of this wrapper.
ofcourse, dec2hex - could just be fixed.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
05 Sep 2008 Urs (us) Schwarz

why not simply

dec2hex(double(int64_var))

us

08 Sep 2008 James Tursa

Response to comment:

dec2hex(double(int64_var)) doesn't work because it loses precision. You won't get all of the bits of the int64 or uint64 represented in the result.

08 Oct 2008 Rob Andolina

Could you please give an example of the syntax to call this function?

For example, how could I convert the decimal/floating point numbers:

15
-15
1056546.1498564
-975465154.168784

Into a hexadecimal format. This would be very helpful to me in 64bits, but would really prefer 72bits right now. Is there anyway to generate a 72bit result for a hexadecimal number that would then be 18 characters long?

08 Oct 2008 Rob Andolina

sorry, I meant to write decimal/fixed point numbers not floating point

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data import Kobi Kai Calev 22 Oct 2008 10:17:45
data export Kobi Kai Calev 22 Oct 2008 10:17:45
dec2hex Kobi Kai Calev 22 Oct 2008 10:17:45
hex Kobi Kai Calev 22 Oct 2008 10:17:45
fix Kobi Kai Calev 22 Oct 2008 10:17:45
conversion Kobi Kai Calev 22 Oct 2008 10:17:45
binary Kobi Kai Calev 22 Oct 2008 10:17:45
hex ariff 02 Jul 2009 02:45:46

Contact us at files@mathworks.com