Skip to content

hex2dec: Hexadecimal text has too many digits for specified or implied type suffix. #1

Description

@Lebsasha

When tried to test your HashMap in Matlab 2024a, it complains about usage of hex2dec function, as described in screenshot.

Screenshot_2024-06-05_02-20-29

It seems to occur because of converting hashSum (representing unsigned 128 bit integer number as char array) to double would definitely loss precision (and it really looks strange). But if leaving anything as it is, Googling suggests to replace hex2dec function with "pow2([96, 64, 32, 0]) * sscanf(str, '%8x')".

I replaced this line in code in HashMap.hash() function and all tests are now passed:

Running HashMapTest
.......... ...
Done HashMapTest
__________


ans = 

  1×13 TestResult array with properties:

    Name
    Passed
    Failed
    Incomplete
    Duration
    Details

Totals:
   13 Passed, 0 Failed, 0 Incomplete.
   0.18533 seconds testing time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions