hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Ulong array in C# convert to F#

Last post 07-14-2008, 19:23 by dsyme. 1 replies.
Sort Posts: Previous Next
  •  07-14-2008, 14:09 6390

    Ulong array in C# convert to F#

        I am having a strange problem converting some C# code to F#. The code uses an array of unsigned 64bit integers:

            private static ulong[] m_aulongHashCodesA =
            {
                6557995217205458958, 3216546429887213718, 10981975557637945592, 13117948053612451546, 16462319544570117268, 14109089931958414830, 7784257433824872028, 12575758863506724218, 0, 0, 0, 0, 0, 0, 0, 0,.....

    What is the best way to store this in F#?

    I got an unexpected problem when I tried:

    let HashCodesA =
            [|
                6557995217205458958UL; 3216546429887213718UL; 10981975557637945592UL; ....

    The third one generates an error of "int_of_string". It is bigger than the maximum signed int64, but is this not OK?

    Thanks for any help.

  •  07-14-2008, 19:23 6393 in reply to 6390

    Re: Ulong array in C# convert to F#

    This is a known problem with uint64 literals, already fixed in out internal source code.

    As a workaround you can use hexadecimal, or just map System.UInt64.Parse down a list of strings.

    Kind regards

    don

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems