Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does double[,,] represent?

Tags:

In answering a question about double[,], I added a screenshot of LINQPad's output for that data structure:

double[,]

However, I got to wondering what a double[,,] looks like, and LINQPad won't visualize it for me. Additionally, I don't understand the format of the data which goes into it:

   int[,,] foo = new int[,,]    {       {          { 2, 3},          { 3, 4}      },      {          { 3, 4},         { 1, 5}       }    }; 

Can anyone visualize this for me?

like image 917
Bobson Avatar asked Jul 22 '13 19:07

Bobson


People also ask

How are doubles represented?

The doubles are represented in the form mantissa * 2^exponent , i.e. some of the bits are used for the non-integer part of the double number. The part in the fraction can also used to represent an integer by using an exponent which removes all the digits after the dot. E.g. 2,9979 · 10^4 = 29979.

Why are double meanings used?

Double has almost twice the precision as float and is used to store decimal numbers with more digits. It has a 32-bit floating-point precision according to IEEE. It has a 64-bit floating-point precision according to IEEE. It stores up to 7 decimal points and rounds off the rest of the digits.

What does a double variable mean?

A double type variable is a 64-bit floating data type A double type can represent fractional as well as whole values. It can contain up to 15 digits in total, including those before and after the decimal point.


2 Answers

You can think of this has having a set of tables stacked on top of each other. So you would need to specify a triplet to retrieve the item, which would specify which table, column, and row to get the value from.

Here's what a 3x3x3 array can be visualized as:

enter image description here

like image 79
Nathan Dace Avatar answered Sep 20 '22 20:09

Nathan Dace


It's a Rectangular Cuboid.

It's a three dimensional solid with 6 faces, all being rectangles.

You can further imagine that cuboid being broken up into a number of cubes, and each of those cubes having a single value.

like image 29
Servy Avatar answered Sep 20 '22 20:09

Servy