Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Decimal vector -> Whole integers vector

Name: Anonymous 2011-12-23 21:15

Turn vector of decimal numbers into whole integers:

I need a general algorithm to turn a vector of non-repeating decimal numbers into whole integers. For instance:

v1 = 3.3837475943, 89.391713934747847847, 23.282781272732734, 32.838723

Now what operations would I need to do to turn that vector/matrix uniformly into whole integers like:

v2 = 22828, 3838, 281, 3999

Adhere to valid matrix operations:
http://en.wikipedia.org/wiki/Elementary_matrix#Operations

Name: Anonymous 2011-12-23 21:26

lambda v: map(round, v)

Name: Anonymous 2011-12-23 21:53

>>1
v2 does not appear to have the relation you want it to have with v1.

If you just want to round it, here's an example:
CL-USER> (mapcar #'round '(1.2 3.5 -1.9))
(1 4 -2)

It's really too trivial to do in any language: you just need a way of mapping or looping over some array, list, collection, sequence and a rounding function which is applied to each element.

Name: Anonymous 2011-12-23 22:49

OP here. Sorry about being vague. Here is a video I just put together that better explains what I'm talking about.

http://www.youtube.com/watch?v=GSxzPpEZ43Y

Name: Anonymous 2011-12-23 23:31

>>4
You're a god damned retard.

Name: Anonymous 2011-12-23 23:42

Video question? That's low even for /g/

Name: Anonymous 2013-08-31 7:49


More formally, a non-zero number can be used for two purposes: to describe the size of a set, or to describe the position of an element in a sequence. For finite sets and sequences it is easy to see that these two notions coincide, since for every number describing a position in a sequence we can construct a set which has exactly the right size, e.g. 3 describes the position of 'c' in the sequence <'a','b','c','d',...>, and we can construct the set {a,b,c} which has 3 elements. However when dealing with infinite sets it is essential to distinguish between the two — the two notions are in fact different for infinite sets. Considering the position aspect leads to ordinal numbers, while the size aspect is generalized by the cardinal numbers described here.

Name: Anonymous 2013-08-31 8:33


In mathematics, "infinity" is often treated as if it were a number (i.e., it counts or measures things: "an infinite number of terms") but it is not the same sort of number as the real numbers. In number systems incorporating infinitesimals, the reciprocal of an infinitesimal is an infinite number, i.e., a number greater than any real number.

Name: Anonymous 2013-08-31 9:19


This does not necessarily mean that physical infinities exist; it may mean simply that the theory is incapable of describing the situation properly. Two other examples occur in inverse-square force laws of the gravitational force equation of Newtonian gravity and Coulomb's law of electrostatics. At r=0 these equations evaluate to infinities.

Name: Anonymous 2013-08-31 10:05


Sets and proper classes. These include Von Neumann–Bernays–Gödel set theory, which has the same strength as ZFC for theorems about sets alone, and Morse-Kelley set theory and Tarski–Grothendieck set theory, both of which are stronger than ZFC.

Name: Anonymous 2013-08-31 10:50


Another approach is taken by the von Neumann–Bernays–Gödel axioms (NBG); classes are the basic objects in this theory, and a set is then defined to be a class that is an element of some other class.

Don't change these.
Name: Email:
Entire Thread Thread List