» Home » double » Page 1
Junit difference between assertEquals(Double, Double) and assertEquals(double, double, delta)
by diablo805 in Programming Languages

I had a junit test asserting two Double objects with the following:

Assert.assertEquals(Double expected, Double result);

This was was fine then I decided to change it to use the primitive double instead which turned out to be deprecated unless you also provide a delta.

so what I am wondering is what is the difference between using the Double objec

Does Interlocked.CompareExchange(double,double,double) work in 32 bit OS?
by daveybrat in Programming Languages

I'm maintaining a high performance class that can be operated on by multiple threads. Many of the fields are volatile ints, and as it turns out I need to upgrade one of those to a double. I'm curious if there is a lock free way to do this, and was wondering if the Interlocked.CompareExchange(double, double, double) works as advertised on a 32-bit OS, or are torn reads a problem.

Java Cast from Object[] to double[] array and Double[] to double[] array
by Florian Derudder in Coding

Is there a way to cast an Object[] array into double[] array without using any loops. And cast Double[] array to double[] array

How Do I define a Double Brackets/Double Iterator Operator, Similar to Vector of Vectors'?
by ivoidwarranties in Programming Languages

I'm porting code that uses a very large array of floats, which may trigger malloc failures from c to c++. I asked a question about whether I should use vectors or deques and Niki Yoshiuchi generously offered me this example of a safely wrapped type:

template<typename T>
class VectorDeque

Joining a Double Base Chain Stitch to Form a Double-Loop Crochet
by apaunchev in Hobbies, Games & Toys
A double base chain stitch is the foundation stitch for a crochet project. Unlike a regular base chain stitch, the double base chain stitch offers more flexibility in the yarn; it’s also easier to work the next stitch into this kind of chain. A double loop stitch in crochet makes little loops on the outside of your crochet to create a three-dimensional feel to the piece and to give it added

Converting String to double in java. Change format of printed double
by weenerdog in Java

I am reading a following CSV file in java and

1191196800.681 - !AIVDM,1,1,,,13aG?N0rh20E6sjN1J=9d4<00000,0*1D

Here is my code to read this CSV file and convert the 1st column of the CSV file (which is a String) to a double

public class ReadCSV {
public static void main(String[] args) {
try {
BufferedReader CSVFile

conversion from string to double with number greater than std::numeric_limit<double>::digits10
by SeaSerpent in Programming Languages
std::string str = "12345679012.124678";
double back = boost::lexical_cast<double>( str );
std::string str2 =boost::lexical_cast<std::string>( back );
//here str2 is equal to str

Is it normal that there is no loss here (i.e final string = orignal string) even if number's significand digits is greater than std::numeric_limit<double>::

How to replace two double quotes with a single double quote in Java String?
by GunnarHafdal in Java

I am reading a CSV file and have some values like

field 1 field 2 field 3
1 test case1 expecting one, and "two", and three

after reading file into a StringBuilder and converting toString() I split the file content by: string.split(",(?=([^"]*"[^"]*")*[^"]*$)");.

On iterating t

How do I replace double quotes within csv fields but not add a trailing double quote to each line?
by Matt Willtrout in Programming Languages

I have a csv file named data_export_20130206-F.csv. It contains data that contains double quotes (") which is making it very messy to parse.

File looks kind of like this (but with more fields)

"<?xml version="1.0" encoding="utf-8" ?>","90210"

I want to "escape" the quotes that are within the fields so it will look lik

Difference between double… and double[] in formal parameter type declaration
by evisseliaib in Programming Languages

I have question: what is the difference between these two declarations?

public static void printMax(double... numbers) { ... }
public static void printmax(double numbers[]) { ... }

Is double... numbers the same as double numbers[]?

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .