Logo

Programming-Idioms

History of Idiom 5 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-08-21, 23:01:23

Version 10

2015-08-22, 02:02:37

Idiom #5 Create a 2D Point data structure

Declare a container type for two floating-point numbers x and y

Idiom #5 Create a 2D Point data structure

Declare a container type for two floating-point numbers x and y

Code
Type
  TPoint = Record
    x : Double;
    y : Double;
  End;
Comments bubble
Pascal uses unit math to define type float.

You can use one of Pascal's floating point types directly (being type single or type double), depending on which precision is required.