Bifalgorithm post · Computer science one · Declaration & Assignment

What primitive types does C support?

What primitive types does C support? (Computer science one · Declaration & Assignment) — "The three primary primitive types supported in C are int, double, and…

Ideas in this flowchart

  • C admite tres tipos primitivos principales: int, double y char
  • int representa números enteros
  • El estándar de C garantiza que int tenga al menos 16 bytes
  • En la mayoría de los sistemas modernos, int suele ser un entero con signo de 32 bits
  • Un int con signo de 32 bits representa valores entre −2.147.483.648 y 2.147.483.647
  • double representa números de coma flotante de doble precisión según IEEE 754
  • double proporciona aproximadamente 16 dígitos de precisión
  • C también proporciona float y modificadores como short, long, unsigned y signed
  • float y los modificadores pueden depender del sistema o de versiones posteriores del estándar, como C99
  • Para mantener un código portable e interoperable, se utilizan principalmente int y double
  • char suele ocupar un byte y representa un carácter ASCII individual
  • char puede tratarse como un entero en el rango de 0 a 127 o de 0 a 255, según la tabla ASCII
Feed/

What primitive types does C support?

No cover

Channel

Computer science one

1 page

"The three primary primitive types supported in C are int, double, and char, which support integers, floating point numbers, and single ASCII characters. Integer (int) types are only guaranteed to “be at least” 16 bytes by the C standard but are usually 32-bit signed integers on most modern systems. With a 32-bit signed int we can represent integers in the range −2,147,483,648 to 2,147,483,647. Doubles (double) types are double-precision floating point numbers as per the IEEE 754 standard and provide about 16 digits of precision. C provides a float (single precision floating point number) type and there are various modifiers such as short, long, unsigned and signed that can be used, but these are either system-dependent or rely on later versions of the C standard (such as C99). We will restrict our focus to more portable, interoperable code and stick with the basic int and double types in our code. Finally, the char type is typically a single byte that represents a single ASCII character. For all intents and purposes a char can be treated as an integer in the range 0 to 127 (or 255) as defined by the ASCII text table (see Table 2.4)."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.