[
https://issues.apache.org/jira/browse/NUMBERS-156?focusedWorklogId=607925&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-607925
]
ASF GitHub Bot logged work on NUMBERS-156:
------------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jun/21 14:56
Start Date: 07/Jun/21 14:56
Worklog Time Spent: 10m
Work Description: darkma773r commented on a change in pull request #92:
URL: https://github.com/apache/commons-numbers/pull/92#discussion_r646666596
##########
File path:
commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/DoubleUtils.java
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.examples.jmh.arrays;
+
+import org.apache.commons.rng.UniformRandomProvider;
+
+/** Class containing utility methods for working with doubles.
+ */
+final class DoubleUtils {
+
+ /** No instantiation. */
+ private DoubleUtils() {}
+
+ /** Create a random double value with exponent in the range {@code
[minExp, maxExp]}.
+ * @param minExp minimum exponent value
+ * @param maxExp maximum exponent value
+ * @param rng random number generator
+ * @return random double
+ */
+ static double random(final int minExp, final int maxExp, final
UniformRandomProvider rng) {
+ // Create random doubles using random bits in the sign bit and the
mantissa.
+ final long mask = ((1L << 52) - 1) | 1L << 63;
+ final long bits = rng.nextLong() & mask;
+ // The exponent must be unsigned so + 1023 to the signed exponent
+ final long exp = rng.nextInt(Math.abs(maxExp - minExp) + 1) + minExp +
1023;
Review comment:
I just documented the requirement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 607925)
Time Spent: 4h 50m (was: 4h 40m)
> SafeNorm 3D overload
> --------------------
>
> Key: NUMBERS-156
> URL: https://issues.apache.org/jira/browse/NUMBERS-156
> Project: Commons Numbers
> Issue Type: Improvement
> Reporter: Matt Juntunen
> Priority: Major
> Attachments: performance-all.png, performance-len-1-5.png,
> performance2-1-5.png, performance2-all.png, performance3-1-5.png,
> performance3-all.png, performance4-1-5.png, performance4-all.png,
> performance5-1-5.png, performance5-all.png
>
> Time Spent: 4h 50m
> Remaining Estimate: 0h
>
> We should create an overload of {{SafeNorm.value}} that accepts 3 arguments
> to potentially improve performance for 3D vectors.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)