What is Type: Definition and 952 Discussions

In programming languages, a type system is a logical system comprising a set of rules that assigns a property called a type to the various constructs of a computer program, such as variables, expressions, functions or modules. These types formalize and enforce the otherwise implicit categories the programmer uses for algebraic data types, data structures, or other components (e.g. "string", "array of float", "function returning boolean"). The main purpose of a type system is to reduce possibilities for bugs in computer programs by defining interfaces between different parts of a computer program, and then checking that the parts have been connected in a consistent way. This checking can happen statically (at compile time), dynamically (at run time), or as a combination of both. Type systems have other purposes as well, such as expressing business rules, enabling certain compiler optimizations, allowing for multiple dispatch, providing a form of documentation, etc.
A type system associates a type with each computed value and, by examining the flow of these values, attempts to ensure or prove that no type errors can occur. The given type system in question determines what constitutes a type error, but in general, the aim is to prevent operations expecting a certain kind of value from being used with values for which that operation does not make sense (logic errors). Type systems are often specified as part of programming languages and built into interpreters and compilers, although the type system of a language can be extended by optional tools that perform added checks using the language's original type syntax and grammar.

View More On Wikipedia.org
  1. V

    How Do You Calculate the Fly's Displacement in a 3D Room?

    I was not sure what the title of this thread should be. This should probably give you an idea of how little I understand this problem: A room has dimensions 3.00 m (height) x 3.70 m x 4.30 m. A fly starting at one corner flies around, ending up at the diagonally opposite corner. A) What is the...
  2. D

    Find the lattice type and base in 2D crystal

    Homework Statement Draw the position of the atoms in the two neighboring planes of the GaAs crystal perpendicular to vector [010]. Find the type of the lattice and the basis of 2D crystal which is made by singling out those two neighboring layers from 3D lattice. Homework Equations...
  3. Darth Frodo

    What's your favorite type of chocolate?

    So guys? What's your favorite type of chocolate? Dark Chocolate? Milk Chocolate? White Chocolate? Mine is probably dark chocolate?
  4. J

    Different type of solenoid design help

    Hi my name is Juan Motta and i´m new in this forum, I`m a total begginer in physics. I´m planning to build a solenoid (air coil or iron coil, i don´t know) with different form, like this: http://www.divshare.com/img/thumb/19310413-b22.jpg And i have some cuestions about, because i...
  5. Chronos

    ESO sheds light on type II supernova

    ESO recently announced its finding that a surprisingly high percentage of type O stars have companions [http://www.eso.org/public/news/eso1230/] . An equally surprising high percentage have 'vampiric' companions that feed off them, which appears to answer at least one hitherto puzzling...
  6. C

    How to solve these type of Ochem problems?

    Addition of HCI to 3-methyl-l-pentene gives two products. One of these is 2-chloro-3-methylpentane. What is the other product? answer: 3-chloro-3-methylpentane Please help me, I have a test tomorrow and I'm unsure of how to do this type of problem. I started out by drawing the molecule...
  7. A

    Unable to solve type of question (dynamics): finding coefficient of friction

    So I've been busting my head for the past 2 days trying to figure out what I was doing wrong and I just can't. I have a whole bunch of these types of questions and can't solve any of them. My own equations and reasoning make sense to "me" but don't lead me to the right answer. I am positive I'm...
  8. C

    What is the name and solution method for this type of equation?

    While reading a paper i have come across an equation in the following form; a = b - f(c) \leq 1 What is this style of equation called and how do you solve them? Thanks Confused
  9. P

    Fortran Type mismatch problem FORTRAN 77

    Hi all, I am trying to run a long FORTRAN 77 code in my laptop. Document contains a makefile and it is instructed to use 'make pgi' command to compile. Beside many warnings, each time I enter that command, it returns me ' Return type mismatch of function 'cmod' at (1) (REAL(4)/REAL(8))...
  10. S

    ? on what type of pennuim my old hp use?

    what pennuim does hp pavilion a305w use?
  11. L

    General uncertainties question - type B

    Homework Statement i am trying to quanify uncertainties.. Homework Equations The Attempt at a Solution For type B uncertainties I have calibration of the oscilloscope, scale reading of the ocilloscope and the uncertaninty of the setup, with associated percentage errors of 2.5%...
  12. M

    Mastering Buffer Solution Problems for Understanding pH Changes

    I have a somewhat decent understanding of what a buffer is (stops an acid/base from changing the pH so dramatically), but when it comes to problems involving them, I am flat out lost and I haven't been so frustrated before. What is there to know about these types of questions, like what will the...
  13. S

    MHB Help on Trigonometric sums. (Assorted type)

    I have some questions and doubts in trigonometry. I hope somebody can solve these questions. Q1) If for real values of x, cos\theta = x +\frac{1}{x}, then a) \theta is acute angle b) \theta is right angle c) \theta is an obtuse angle d) no value of \theta is possible I will post the following...
  14. B

    What type of digital signaling is more efficient, digital DC or digital AC?

    What type of digital signaling is more efficient, digital DC or digital AC? With digital DC, the square-wave signal is only between a (+) value and 0. With digital AC, the square-wave signal is between a (+) & (-) value.
  15. W

    Why is the first type bessel function called first?

    what is the difference between first- and second-type bessel functions?
  16. S

    How to pass derived type argument to a subroutine

    Hi all ! I have a derived type as: TYPE type_atom_type_info integer:: type_code character(len=4)::type_cname real(kind=dbl)::mass end TYPE type_atom_type_info I have an array of this type as: TYPE(type_atom_type_info) atom_type_info(250) I want to pass this array to a...
  17. Avatrin

    Why is this a type II double integral?

    ∫∫_{A}xy^{2}dxdy A is the area between y = x^2, y = 2-x and x\geq0. I am told that this is a type II double integral and I thus have to: ∫^{1}_{0}∫^{2-y}_{√y}xy^{2}dxdy But, why can't I do this? ∫^{2}_{0}∫^{2-x}_{x^2}xy^{2}dydx
  18. S

    What type of work are you involved in

    Hi everyone. I had previously had a poll which identified how many people had worked in an area related to their field of study in graduate school versus those who worked in a different field. I'm starting a new poll which parses this information a little more precisely than previously. Of...
  19. D

    Permanent Magnet Motors vs. Non-Magnetic Motors: Which is the Superior Choice?

    Choose between two: A. Permanent magnet motors( Being the shaft/rotor) B. Non-magnetic material( Same being the shaft/rotor) Give me you're answer and a detailed explanation why please!
  20. N

    Question about and request for a certain type of integration problem

    Homework Statement http://img806.imageshack.us/img806/9455/67043570.jpg The Attempt at a Solution http://img443.imageshack.us/img443/2449/50431877.jpg The part I got confused at was during the substitution. I understand that there is a bound change (1,9) because we just sub in...
  21. A

    Engineering What type of (linear) motor do I need?

    Homework Statement I want o make a programmable electric/electronic 4 seated teeter toter(sp?) Instead of being manually operated using weight to push one end down, and drive to other up, I want to electronically push UP one end-thus driving the other down (my electronics knowledge has...
  22. R

    Could a new type of compass be created using a rotating permanent magnet?

    Hello everyone. As a youngster I was asked to float a sewing needle on top of a full glass of water after I had magnetised it with a permanent magnet. The glass was so full the water was convex, slowly edging the point of the need toward the center of the glass. Noticing the capillary action...
  23. R

    What type of software to configure coils, inductors, transformers?

    What type of software? Hello everyone, I'm looking for a simple software program that I may be able to configure coils, inductors, transformers, core selection etc. Basic ic availability, selection of switches, LEDs, types/strenghths/shapes of permanent magnets. I'm aware that there is a lot...
  24. H

    How to read a specific type of dimensional analysis

    In some work I have been following, I keep seeing notation like: for energy ... ML^2 T^{-2} How is this supposed to be read? I understand this is using mass, length and time, but what is it saying? Would I be right in thinking it says ''mass times length squared divided by time...
  25. D

    Supernovae Type Ia: Redshift, Luminosity & Speed

    Homework Statement Supernovae type Ia has a red shift z=1.1. Observed luminosity of the star has changed in the interval of 60 days. What time interval would an observer measure in the near vicinity of the star? What is the speed that the star is moving away from us? What is the distance of the...
  26. vmr101

    Define the Domain of a lamina as union of Type 1 and Type 2 regions?

    Homework Statement Consider a lamina (two dimensional plate) with edges given by the lines y = sqrt(x) and y = -x + 2x^(2), for which the density is given by P(x; y) = x. (a) Define the domain of the lamina as the union of a Type 1 region and a Type 2 regions. b) Calculate the mass. Just...
  27. D

    Link to description of detector type for double-slit experiment

    Can someone supply me with a link to a good article or book, or anything, that gives details on the type of detector that determines "which way" in experiments where the double-slit interference pattern is cancelled? DC
  28. C

    Why Does the Bode Plot of a Type 1 System Show a Damped Slope Initially?

    For a transfer function of G(s) = 100 / (s(s+5)), I'm having trouble finding the initial magnitude in dB. It's a type 1 system. If it was a type 0 system with only (s+5) in the denominator, the initial magnitude would be 20log(nominator/denominator) where s is an element of 0, and would decrease...
  29. F

    Maximizing Accuracy in K Type Thermocouple Measurements

    Hello all, I'm looking to buy an accurate K Type thermocouple and I have a couple questions concerning accuracy before I make my decision. -If it is a K Type thermocouple, does it matter how the probe is configured? e.g. length etc.? -Is there any discrepency in accuracy between different...
  30. I

    What type of engineering to go into?

    Well, I'll be entering college in the fall and I have yet to decide on a major. I am interested in engineering, but there are multiple fields that I am interested in: engineering mechanics, mechanical engineering, and electrical engineering. The reason I want to do either engineering mechanics...
  31. L

    Probability of drawing at least x cards of type A in n draws

    I've been asked to give a workshop at my local youth center about a certain card game (MtG for those that know it). The last time I did this was a few years ago and I lost some of my notes in the mean time. I always presented the attendants with a little spreadsheet with a variety of useful...
  32. T

    Black-Scholes equation (a type of diffusion equation)

    Homework Statement The equation for the probability distribution of the price of a call option is \frac{\partial P}{\partial t} = \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 P}{\partial S^2} + rS\frac{\partial P}{\partial S} - rP with the conditions P(0,t) = 0, P(S,0) = \max(S-K,0), and...
  33. 0

    Transmitter uses radio waves or any type of waves

    Hi: I'm new in this site I need help here please I need a circuit that works as : 1- transmitter uses radio waves or any type of waves 2- sends waves for long way more than 3 km 3- consist of simple component than can be found in old electronic instruments such as old TV or radio...
  34. I

    Flux tubes in a Type II Superconductor

    What would happen if a magnetic field is generated inside of a Type II superconductor? Would there be flux tubes?
  35. Femme_physics

    Is an AD converter a type of encoder/decoder?

    According to wiki: So can we call an AD converter an encoder?
  36. K

    Transformations of Energy in a Pendulum Type Experiment

    Homework Statement The string in Fig. 8-35 is L = 120 cm long, has a ball attached to one end, and is fixed at its other end. The distance d to the fixed peg at point P is 75.0 cm. When the initially stationary ball is released with the string horizontal as shown, it will swing...
  37. B

    Rail Gun type problem - find distance of particle traveled with minimal data

    Homework Statement Hello. I want to help a friend solve a problem. I'm having trouble finding the right way to solve for distance for this problem. I am given 2 parallel wires connected by another wire or perhaps a conducting fuse. His information is kind of vague, sorry. The current goes up...
  38. H

    What's this type of knowledge called?

    Greetings everyone, This is just a vocabulary question, rather than a conceptual one. Is there a word for "qualitative knowledge"? For example, through science we have quantitative descriptions of all sorts things - the color blue, for example, is described as photons with wavelengths in the...
  39. S

    Differential Equation: d^2y/dx^2 + y = 0

    Hi guys, Is there a general name for equations like this? If so, what is it? d^2y/dx^2 + y = 0 Any links to webpages about this type of diff eqn would be goof too? thanksssss
  40. O

    Type 1a Supernova - linking Nickel decay to luminosity

    Homework Statement I have a question in my coursework where I don't know where to start. I've got Nickel decaying post the explosion, I've got a time t, I've got an energy release per nucleus of Nickel, I've got a decay constant, I've got a light curve decay half life, and I've got a...
  41. O

    Help determining type of dicrete signal: power or energy signal

    Homework Statement Firstly, I'm sorry for my bad English - I'm from Bosnia and Herzegovina. I need help in determining type of two discrete signals. Here are problems: 1) 2) I have tried, and I posted below where I stopped and what's confusing me. Homework Equations The...
  42. T

    Fingerprint of God type physics; what's meant and what qualifies?

    "Fingerprint of God" type physics; what's meant and what qualifies? Hello everyone, I've been watching a lot of documentaries lately (understanding very little) and I decided to join this forum so I could actually ask questions in what will probably be a vain attempt to make sense of the...
  43. S

    Approximation of distance to a Type Ia

    Homework Statement The Type Ia supernova SN 1963p in the galaxy NGC 1084 had an apparent blue magnitude of B = 14.0 at peak brilliance. Then, with an extinction of 0.49 mag to that galaxy, the distance to the supernova is approximately d = 10(m - M - A + 5)/5 = 41.9 Mpc Homework...
  44. R

    What type of Engineer do I need?

    Hello, I currently have an idea to initiate for my start-up business. Therefore, I do not have the skill to do it. Will it be feasible to hire an engineer? The project consists to build a tablet with few built-in that are not currently in the market. We have found several suppliers, like LG...
  45. Z

    C/C++ C++ how to check for variable type?

    So, I want to use cin >> to get a user input that must only be int. How can I check the type of the input? Thanks.
  46. C

    Error: expected constructor, destructor, or type conversion before ';' token

    I'm newbie in C programming... i'm trying to make my arduino board works but still find error when compiling the C programming, the errors are: driving7segmentusingmultipleshiftregisters3:2: error: expected constructor, destructor, or type conversion before ';' token...
  47. Z

    LaTeX Easier way to type out LaTeX assignments?

    Hello, I've recently been asked to submit my assignments using LaTeX and its really time consuming to have to type \begin{math} \end{math} every time I need to switch between English and math symbols. Can you suggest me a LaTeX editor that can speed up the process? (like with auto-fills...
  48. C

    What type of expansion is this?

    When I am reading the paper about Rayleigh instability, I found this type of expanding method. \sqrt{1+(\frac{2\pi\delta}{\lambda})^2 \cos^2(\frac{2\pi x}{\lambda})} = 1 + \frac{1}{2}(\frac{2\pi\delta}{\lambda})^2\cos^2 (\frac{2\pi x}{\lambda}) + \cdots Can someone tell me what type...
  49. T

    How to find type of conic section from its general equation?

    Given the general equation of conic section: Ax2+Bxy+Cy2+Dx+Ey+F=0 How can we find the type of conic section from the above equation? I've used method of rotating coodinate around the origin (from Oxy to Ox'y', Ox' makes an angle θ to Ox, counterclockwise) such that the symmetry axes of the...
  50. G

    Which type of actuator fits the job

    Ok, maybe not actuator.. I need to decide between two types of solenoids? Not 100% on what they are called but i'll try to get the gist of it across. I want to be able to be able to build a system where a piston strikes a mechanism in a linear motion, and I am not sure if air or electric ones...
Back
Top