- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Large Decimal to Hex Conversion in C
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2003 09:48 AM
тАО07-14-2003 09:48 AM
Large Decimal to Hex Conversion in C
Any suggestions on how to go about this would be appreciated.
Thanks,
Brad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2003 01:17 PM
тАО07-14-2003 01:17 PM
Re: Large Decimal to Hex Conversion in C
since you are looking for a HP-UX library and not for an hp OpenVMS one, you most probably will get much better answers in the hpux/language area at
http://forums.itrc.hp.com/cm/CategoryHome/1,,150,00.html
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2003 10:33 PM
тАО07-14-2003 10:33 PM
Re: Large Decimal to Hex Conversion in C
I answer as OpenVms works, but HP-Ux may be different.
On OpenVms you can compile using long type 32 or 64 bit. Naturally with 32 bit long you cannot convert 25516777215 but using 64 bit long you can convert using standard sscanf function.
If you cannot found 64 bit long in HP ux write again: send you a function to convert a string to a hex string (not is possible manager numeric in this case).
HTH
Antoniov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 11:43 AM
тАО07-18-2003 11:43 AM
Re: Large Decimal to Hex Conversion in C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 12:06 PM
тАО07-18-2003 12:06 PM
Re: Large Decimal to Hex Conversion in C
Clay you were right. I added the +DD64 flag to the compilation line and it worked. I asked one of our UINIX team, they did a little research and came up with the same suggestion so I tried it and it worked.
Antoniov mentioned the sscanf to convert it which I was unfamiliar with, scanf did not handle the large number and I was unfamiliar with sscanf at the time. I ended up using atof and cast the result as an unsigned long long which truncated the decimal places from the result. I tested the $%#@ out of it to ensure it was going to work correctly and it did.
Thanks for taking the time to post suggestions. I am very appreciative.
Brad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2003 01:13 AM
тАО07-19-2003 01:13 AM
Re: Large Decimal to Hex Conversion in C
pc03:/W 283 $ perl -Mbigint -le'$x = 24354**245; print $x->as_hex'
0x44feca8dca03b4a7f6c74b327fb1f5fce5853557cfdb7ee961d45dca4f33a899df3ef7f213b050
4e58c65946eb54bc307f4d62b6d3ae93495f55df69b154b1666ebea5233cb9b2a455d2f1e2758c75
2fe932781920d56cc8060f3020bb00736ea407783194ab3837500f021cb0bb3b022b4cf69dd4d71c
ab55194f3865562753cb1718fd947e25806a914cb29011d4dc476983d0a3057f0ae0798805379fb2
157e07eb353211f14e821df9f5e198dc4fcc356c42dc59cd692931c02398644031c9740423839923
dabe0d8da87849945915907bd6eebff1f03c5b63726cd9aaf9d602f204cfd29ae23dfec82bc99dc3
a05d6e0fb8be22ace5459fc1caab2a9c1410d507fd7b94e7496608c2688b5b691542da03ea8ea391
8adbc92e17a791bcab856eb83522148cdd03f41b485cb10f4762d5c8a307a24e2a521d2936cb23ff
72c5a21872d099f374ecc05b73a0557a166f28ea1dfd1279694a0c159dd527e73c3552bcc01d009c
dd3ccf7eb2e2963fc732cc351ac2846134faa28f57f8d42e021516e9d19ce463576be4c628a59b80
a1e730c73da905ed934c253791060d8da20000000000000000000000000000000000000000000000
000000000000000
pc03:/W 284 $
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2003 12:34 PM
тАО08-23-2003 12:34 PM
Re: Large Decimal to Hex Conversion in C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2003 02:06 PM
тАО09-17-2003 02:06 PM
Re: Large Decimal to Hex Conversion in C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:39 AM
тАО09-30-2003 06:39 AM