I am using various fields, including Number or Currency type ones, in two different object types to form a "key" to allow me to generate an "identity" that I can use in a Map in Apex code, which I then use to store and retrieve details relevant to the one type of object AND the other.
These "keys" are implemented as simple Object arrays (since the field types vary), but the fields used at each index are equivalent from the first object type and the second. When I have a Number or Currency type field, these values are represented by Decimal values in Apex.
For (a very contrived) example, I might use the Account's AnnualRevenue field to match with a custom RevenueBreakdown__c's TotalRevenue__c field, both being Currency fields, in order to access data from my Map<Object[], SomeApexClass>.
However, I'm finding that, while the individual values in the key may be the same, the Map is not correctly retrieving the stored data. Any clues why?