Re: Number operations and comparisons
2010-06-01 02:14:04 GMT
I think the consistency we have right now is that everything except Doubles goes through Float because that's what asLimitedPrecisionReal does. I understand it may not be the kind of consistency you want, though :). Unfortunately, changing it is not that easy because of the implications. We might have to wait until 8.0 to do that, because then we get a license to potentially break backwards compatibility. And perhaps it's not a good idea at all, imagine tests written like self assert: -1 sin = Float pi, or self assert: resultOfNumericalCalculations = someResultThatHappenedWithThePreviousCode, or you load old data from the database and you find that you can't reproduce the old results, etc. Roughly speaking, it's not clear what the behavior of veryLargePositiveInteger log should be. For example, > Well I do know that you know a lot more about mathematics than I do, but I thought a little bit of bit copy operations on the binary representation of a LargePositiveInteger to convert it to a Doubles mantissa plus some basic log-mathematics would have helped. Well but see, the problem is that to get an accurate result you may need to calculate log 2 to a lot of decimals so that you can do things like veryLargePositiveInteger log = = (2^k * smallerLargePositiveInteger) log = k log 2 + smallerLargePositiveInteger log with some degree of accuracy. What degree of accuracy are we talking about? What if a double does not have enough significant digits so when you do 10^(veryLargePositiveInteger log) you get veryLargePositiveInteger back? Since veryLargePositiveInteger does not(Continue reading)
RSS Feed