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:08:07 UTC

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

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 519d8f7  GROOVY-8678: allow floating point literals without leading zeroes
519d8f7 is described below

commit 519d8f73c6aff8d2c57156f498bddb84b7075547
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Jun 11 23:07:58 2021 +1000

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

diff --git a/site/src/site/releasenotes/groovy-4.0.adoc b/site/src/site/releasenotes/groovy-4.0.adoc
index 1fa3433..82f17e3 100644
--- a/site/src/site/releasenotes/groovy-4.0.adoc
+++ b/site/src/site/releasenotes/groovy-4.0.adoc
@@ -571,6 +571,18 @@ From Groovy 4, ranges can be closed, open on the left, e.g. `3<..5`, right or bo
 The range will exclude the left or right-most values for such ranges.
 link:https://issues.apache.org/jira/browse/GROOVY-9649[GROOVY-9649]
 
+=== Support for decimal fraction literals without a leading zero
+
+Groovy has previously required a leading zero for fractional values, but leaving off the leading zero is now also supported.
+
+[source,groovy]
+--------------------------------------
+def half = .5
+def otherHalf = 0.5  // leading zero remains supported
+double third = .333d
+float quarter = .25f
+--------------------------------------
+
 === JSR308 improvements (incubating)
 
 Groovy has been improving JSR-308 support over recent versions.