See [R94, p.26-27, p. 142, p. 157]
| This code is dangerous: the calculations may easily cause overflow
| Choose the data type carefully.
Examples:
volume6 (Point3 (512,512,512)) (Point3 (512,-512,-512)) (Point3 (-512,512,-512)) (Point3 (-512,-512,512)) :: Integer
2147483648 :: Integer
volume6 (Point3 (600003,0,0)) (Point3 (0,600003,0)) (Point3 (0,0,600003)) (Point3 (200001,200001,200001))
0 :: Int
But:
volume6 (Point3 (600003,0,0)) (Point3 (0,600003,0)) (Point3 (0,0,600003)) (Point3 (200001,200001,200001)) :: Double
1.71799e+10 :: Double
|