Advertisement Jump to content
Sign in to follow this  

[.net] Radix sort on floats in .NET

This topic is 4894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Thanks for the reply Shannon!

Is a union a good way to get the bits of a float?

using System.Runtime.InteropServices;
struct IntFloat
public int i;
public float f;

Apparantly ints and floats are stored in separate parts of the processor so it won't be free, but oh well [smile]

Ooo - I'll look into Marshall too...I think that can do copying across types without using unsafe code. EDIT: marshall not useful for this. I don't want to use unsafe code because I think that means your IL is unverifiable and the OS will consider your app more dangerous.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!