lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [10/12] lucenenet git commit: Cast the float to a double before converting to a string to get extra precision. This helps keep all the digits for comparison later.
Date Tue, 17 Feb 2015 17:29:52 GMT
Cast the float to a double before converting to a string to get extra precision. This helps
keep all the digits for comparison later.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ad8ca535
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ad8ca535
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ad8ca535

Branch: refs/heads/master
Commit: ad8ca5356c247a243665b2478155ef1c9a974b9f
Parents: 0548f76
Author: Chand2048 <Chand@Microsoft.com>
Authored: Thu Feb 12 12:56:38 2015 -0800
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Tue Feb 17 19:22:15 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Tests/core/Index/TestCustomNorms.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ad8ca535/src/Lucene.Net.Tests/core/Index/TestCustomNorms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestCustomNorms.cs b/src/Lucene.Net.Tests/core/Index/TestCustomNorms.cs
index 9cae1e4..b197cb5 100644
--- a/src/Lucene.Net.Tests/core/Index/TestCustomNorms.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestCustomNorms.cs
@@ -60,7 +60,8 @@ namespace Lucene.Net.Index
             {
                 Document doc = docs.NextDoc();
                 float nextFloat = (float)Random().NextDouble();
-                Field f = new TextField(FloatTestField, "" + nextFloat, Field.Store.YES);
+                // Cast to a double to get more precision output to the string.
+                Field f = new TextField(FloatTestField, "" + (double)nextFloat, Field.Store.YES);
                 f.Boost = nextFloat;
 
                 doc.Add(f);


Mime
View raw message