Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Double To Hexadecimal Convertion [Src included]

I doubt if any of you (or a very little amount of coders) arround here will ever use it tho ^^
I won't use this in my code.
Have a good evening.
(Sep 8, 2014 07:04 AM)TheBarret Wrote:  I doubt if any of you (or a very little amount of coders) arround here will ever use it tho ^^

Because in the real world no one uses HEX in their code, ecxept constants which are always full numbers.
or without structure
Dim D = 1.12345
MsgBox(D.ToString.SelectMany(Function(s) Hex(Asc(s))).ToArray)
(Sep 8, 2014 03:37 PM)Only3 Wrote:  or without structure
Dim D = 1.12345
MsgBox(D.ToString.SelectMany(Function(s) Hex(Asc(s))).ToArray)

Shut up your sick mouth. I have told you hundreds of times, learn to write beautiful code, not short code.
(Sep 8, 2014 03:37 PM)Only3 Wrote:  or without structure
Dim D = 1.12345
MsgBox(D.ToString.SelectMany(Function(s) Hex(Asc(s))).ToArray)

That won't return the correct hexadecimal representation of the double, but the representation of the digit characters that make the double a readable number. Two completely different things.

OT: I am not sure why this is useful actually. When would it be beneficial to write down floating point numbers as a hexadecimal string?
https://github.com/Washi1337

"I'll tell you this UDP joke, and I don't care if you will get it or not."
(Sep 9, 2014 08:38 AM)Washi Wrote:  OT: I am not sure why this is useful actually. When would it be beneficial to write down floating point numbers as a hexadecimal string?

im kinda here with ya also. although it is a good snipp of code (cant deny that). I do not see where the average coder would find this useful. The only thing that i would be able to think of would be to use it in some sort of plugin for a cheat engine type of project. Dont get me wrong, after reading the code. It absolutely looks clean enough that it should work. Personally i dont do much with anything of the nature so i dont have the exact environment to test it on. other than telling you "good job" on what you have described, and knowing your previous work, i can only say good job. Have you thought about taking this and putting it on another forum where it may be more appreciated? you may get better (not the same quantity, but better quality) advice / responses there.

edited for typos and English stupid
(Sep 9, 2014 08:38 AM)Washi Wrote:  That won't return the correct hexadecimal representation of the double, but the representation of the digit characters that make the double a readable number. Two completely different things.

OT: I am not sure why this is useful actually. When would it be beneficial to write down floating point numbers as a hexadecimal string?

😊
Dim D = 1.12345
MsgBox(BitConverter.GetBytes(D).Reverse.SelectMany(Function(b) Hex(b)).ToArray)
Or
MsgBox(BitConverter.GetBytes(D).Reverse.SelectMany(Function(b) b.ToString("X2")).ToArray)
(Sep 9, 2014 12:45 PM)Only3 Wrote:  😊
Dim D = 1.12345
MsgBox(BitConverter.GetBytes(D).Reverse.SelectMany(Function(b) Hex(b)).ToArray)
Or
MsgBox(BitConverter.GetBytes(D).Reverse.SelectMany(Function(b) b.ToString("X2")).ToArray)

...MsgBox...Really?

Only3, go to your largest project, remove the Microsoft.VisualBasic Namespace, and clear out all unused references. How many errors? Your code is irrelevant googled crap until you get that down to 0...Seem fair?
(Sep 9, 2014 01:32 PM)Nikey646 Wrote:  ...MsgBox...Really?

Only3, go to your largest project, remove the Microsoft.VisualBasic Namespace, and clear out all unused references. How many errors? Your code is irrelevant googled crap until you get that down to 0...Seem fair?

😁 Console.Write(BitConverter.GetBytes(D).Reverse.SelectMany(Function(b) b.ToString("X2")).ToArray)
(Sep 9, 2014 11:26 AM)nathan72389 Wrote:  im kinda here with ya also. although it is a good snipp of code (cant deny that). I do not see where the average coder would find this useful. The only thing that i would be able to think of would be to use it in some sort of plugin for a cheat engine type of project. Dont get me wrong, after reading the code. It absolutely looks clean enough that it should work. Personally i dont do much with anything of the nature so i dont have the exact environment to test it on. other than telling you "good job" on what you have described, and knowing your previous work, i can only say good job. Have you thought about taking this and putting it on another forum where it may be more appreciated? you may get better (not the same quantity, but better quality) advice / responses there.

edited for typos and English stupid

I agree with that Nathan,
the usage in general is not often used like this,
For my personal project, the script engine, all the numbers are handled as double, so i had to make a convertion
method going both ways, ofc it also understands normal hex values.

example of "Hello, World" :
[Image: KtCw7uY.png]

So thats was my main reason to implement a floating point hexadecimal convertor.

- B


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by WizardLizardOct 10, 2017 07:18 AM 5 286 Oct 10, 2017 07:18 AM
Last Post: UB3R5W4G0V3RL0RD
[Java] by ♥Quantum♥Apr 8, 2017 12:05 PM 4 208 Apr 8, 2017 12:05 PM
Last Post: thepixelhacker
[Python] by InfamiaJan 30, 2017 02:40 PM 3 136 Jan 30, 2017 02:40 PM
Last Post: Infamia