You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/06/11 13:22:36 UTC

[groovy-website] branch asf-site updated: GROOVY-8678: allow floating point literals without leading zeroes (additional info)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 1b89dc9  GROOVY-8678: allow floating point literals without leading zeroes (additional info)
1b89dc9 is described below

commit 1b89dc934f77e5202a8aec4af201b69161754fd1
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Jun 11 23:22:30 2021 +1000

    GROOVY-8678: allow floating point literals without leading zeroes (additional info)
---
 site/src/site/releasenotes/groovy-4.0.adoc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/site/src/site/releasenotes/groovy-4.0.adoc b/site/src/site/releasenotes/groovy-4.0.adoc
index 82f17e3..0e62e40 100644
--- a/site/src/site/releasenotes/groovy-4.0.adoc
+++ b/site/src/site/releasenotes/groovy-4.0.adoc
@@ -581,7 +581,12 @@ def half = .5
 def otherHalf = 0.5  // leading zero remains supported
 double third = .333d
 float quarter = .25f
+def fractions = [.1, .2, .3]
+def exclusiveRange = -1.5..<.5
+def inclusiveRange = -1.5..0.5 // leading zero edge case <1>
+assert inclusiveRange == [-1.5, -.5, .5]
 --------------------------------------
+<1> The leading zero is still required where the second number in a range specification is a fractional value
 
 === JSR308 improvements (incubating)