Skip to main content
Correction: ECMA-116 not ECMA-110 (the link url was right but the link text was wrong)
Source Link

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater than X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relieve float numbers from their fractions. To use it for rounding, sign handling needs to be implemented differently for positive and negative numbers, requiring a 4-line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast, a Floor implementation works independently of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110116 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners' language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered widespread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter whether 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned triple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater than X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relieve float numbers from their fractions. To use it for rounding, sign handling needs to be implemented differently for positive and negative numbers, requiring a 4-line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast, a Floor implementation works independently of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners' language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered widespread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter whether 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned triple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater than X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relieve float numbers from their fractions. To use it for rounding, sign handling needs to be implemented differently for positive and negative numbers, requiring a 4-line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast, a Floor implementation works independently of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 116 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners' language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered widespread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter whether 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned triple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

Mod Moved Comments To Chat
Spelling and grammar
Source Link
Toby Speight
  • 2.1k
  • 1
  • 15
  • 37

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater asthan X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to reliefrelieve float numbers from their fractions. To use it for rounding, sign handling needs to be implemented differentdifferently for positive and negative numbers, requiring a 4 line-line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast, a Floor implementation works independentindependently of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginnersbeginners' language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered wide spreadwidespread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter ifwhether 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned trippletriple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater as X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relief float numbers from their fractions. To use it for rounding sign handling needs to be implemented different for positive and negative numbers, requiring a 4 line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast a Floor implementation works independent of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered wide spread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter if 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned tripple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater than X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relieve float numbers from their fractions. To use it for rounding, sign handling needs to be implemented differently for positive and negative numbers, requiring a 4-line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast, a Floor implementation works independently of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners' language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered widespread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter whether 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned triple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

added 295 characters in body
Source Link
Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k

It Has (Almost) Always Been Floor

Since at least 19681966, with Dartmouth BASIC V4Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater as X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relief float numbers from their fractions. To use it for rounding sign handling needs to be implemented different for positive and negative numbers, requiring a 4 line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast a Floor implementation works independent of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered wide spread use. This also showsWikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter if 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned tripple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

It Has (Almost) Always Been Floor

Since at least 1968, with Dartmouth BASIC V4, the behaviour of INT is defined as as delivering an integer not greater as X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relief float numbers from their fractions. To use it for rounding sign handling needs to be implemented different for positive and negative numbers, requiring a 4 line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast a Floor implementation works independent of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered wide spread use. This also shows why all later BASIC employ the same workings. No matter if 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned tripple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

It Has (Almost) Always Been Floor

Since at least 1966, with Dartmouth BASIC V3, the behaviour of INT is defined as as delivering an integer not greater as X - which otherwise may be called FLOOR. This is consistent with all BASIC I know.

Why? Because Enhanced Usability

Truncate can only be used to relief float numbers from their fractions. To use it for rounding sign handling needs to be implemented different for positive and negative numbers, requiring a 4 line construct:

100 If I < 0 THEN 130 110 I = INT(I+0.5) 120 GOTO 140 130 I = INT(I-0,5) 140 ... 

In contrast a Floor implementation works independent of the sign always in the same 'direction', enabling easy use in single statement of

I = INT(I+0.5)

Same would have been true for use of Ceiling(*1), except Floor also works like Truncate for all positive numbers. Something easy to understand for beginners (students) thus a perfect compromise for a teaching language. One function good to show two very common use cases.


Some Archaeology

A good starting point in search for default behaviour of BASIC are always the ECMA standards 55 for Minimal BASIC (1978) and 110 for 'full' BASIC (1985). For an item as basic as INT ECMA-55 notes:

enter image description here

(ECMA-55 section 9.4 on page 12)

European ECMA-55 standard which is essentially the same as US ANSI X3.60-1978 standard, which in turn is based on SBASIC, an intermediate step between Dartmouth V6 and V7 made in 1976. Since it was implemented as preprocessor for V6 it can be assumed that Dartmouth BASIC V6 created in 1969, published in 1971 as well used INT with the same definition.

Looking into the 1968 V4 documentation shows the same behaviour

enter image description here

(Page 42 of the BASIC Version 4 manual)

Going back to V2 of 1964 shows different:

enter image description here

(Page 39 of the BASIC Version 2 manual)

This quite complex explanation already shows why Truncate isn't as great for a beginners language as Floor.

The change from 'Truncate' to 'Floor' must have happened before V4 and considerable before it gathered wide spread use. Wikipedia notes that V3 was the first to feature that change. V3 was finished in 1966, a mere two years after the very first BASIC (*2). The early on change supports why all later BASIC employ the same workings. No matter if 1975 Prime BASIC or 1991 Visual BASIC.


*1 - At that point it may become obvious that the function group to look at isn't the mentioned tripple of Truncate/Floor/Ceiling but a quadruple including ROUNDING as well.

*2 - I'm not sure if any other BASIC already existed in 1966.

added 1 character in body
Source Link
Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k
Loading
deleted 7 characters in body
Source Link
Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k
Loading
added 890 characters in body
Source Link
Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k
Loading
Source Link
Raffzahn
  • 249.4k
  • 23
  • 722
  • 1k
Loading