I am using NSExpression to get the sum of some values from core data. The attribute type is set to int64 and the values are in hundreds or thousands of billions. The weird problem im facing is that the sum value is different from the real sum only in a few thousands. Here is the snippet code i use along side my fetch request:
NSExpressionDescription *qtyDescription = [[NSExpressionDescription alloc] init];
qtyDescription.name = @"price";
qtyDescription.expression = [NSExpression expressionForKeyPath:@"@sum.price"];
qtyDescription.expressionResultType = NSInteger64AttributeType;