|
Groovy example source code file (Groovy3894Bug.groovy)
The Groovy Groovy3894Bug.groovy source code
package groovy.bugs
class Groovy3894Bug extends GroovyTestCase {
void testInfinityToBigDecimalConversion() {
BigDecimal x = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
assert x ** 5 == Double.POSITIVE_INFINITY
try {
BigDecimal y = x ** 5
} catch (NumberFormatException nfe) {
assert nfe.message == 'Infinite or NaN'
}
x = -999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
assert x ** 5 == Double.NEGATIVE_INFINITY
try {
BigDecimal y = x ** 5
} catch (NumberFormatException nfe) {
assert nfe.message == 'Infinite or NaN'
}
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy Groovy3894Bug.groovy source code file: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.