Scalar vs. primitive data type - are they the same thing?

后端 未结 7 556
深忆病人
深忆病人 2020-12-07 07:45

In various articles I have read, there are sometimes references to primitive data types and sometimes there are references to scalars.

My understanding of each is th

7条回答
  •  攒了一身酷
    2020-12-07 08:13

    Put simply, it would appear that a 'scalar' type refers to a single item, as opposed to a composite or collection. So scalars include both primitive values as well as things like an enum value.

    http://ee.hawaii.edu/~tep/EE160/Book/chap5/section2.1.3.html

    Perhaps the 'scalar' term may be a throwback to C:

    where scalars are primitive objects which contain a single value and are not composed of other C++ objects

    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1995/N0774.pdf

    I'm curious about whether this refers to whether these items would have a value of 'scale'? - Such as counting numbers.

提交回复
热议问题