What does the *4 mean in integer*4 in fortran77?

  • Context: Fortran 
  • Thread starter Thread starter dimensionless
  • Start date Start date
  • Tags Tags
    Fortran77 Mean
Click For Summary
SUMMARY

In Fortran 77, the expression integer*4 defines a 4-byte integer variable, which is crucial for managing larger integer values. The default integer type is also typically 4 bytes, but this can vary depending on the compiler used. The notation integer*1 and integer*2 specify 1-byte and 2-byte integer variables, respectively. Understanding these distinctions is essential for effective memory management and data type usage in Fortran programming.

PREREQUISITES
  • Understanding of Fortran 77 syntax
  • Knowledge of data types and memory allocation
  • Familiarity with compiler behavior and settings
  • Basic programming concepts related to integers
NEXT STEPS
  • Research Fortran 77 data types and their memory implications
  • Explore compiler options for integer size specifications
  • Learn about data type compatibility in Fortran
  • Investigate best practices for memory management in Fortran programming
USEFUL FOR

This discussion is beneficial for Fortran developers, programmers working with legacy code, and anyone interested in optimizing data types for performance in numerical computing applications.

dimensionless
Messages
460
Reaction score
1
How is
Code:
integer*4
different from
Code:
integer
?
 
Technology news on Phys.org
dimensionless said:
How is
Code:
integer*4
different from
Code:
integer
?

integer*4 is an expression where you multiply integer by 4?
 
Integer*1 => 1 byte integer variable
Integer*2 => 2 bytes integer variable
Integer*4 => 4 bytes integer variable
Integer => 4 bytes by default but can be compiler dependent
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 47 ·
2
Replies
47
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 27 ·
Replies
27
Views
7K