That's the old, less accurate way. By that measure, fiber tends to have quite a lot of calories, as it's a carbohydrate, but that is now known to be wrong - fiber passes through our digestive systems almost completely undigested, and yields almost 0 calories.
Today, calorie counts are usually obtained by checking the protein, fat, sugar and fiber contents, and using known values for calorie/g of each. Those well-known values are ideally obtained either through human calorimetric studies, or through burning protein, fat, sugar directly.
Today, calorie counts are usually obtained by checking the protein, fat, sugar and fiber contents, and using known values for calorie/g of each. Those well-known values are ideally obtained either through human calorimetric studies, or through burning protein, fat, sugar directly.