Click here to Skip to main content
15,891,785 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What a game of rugby Pin
pkfox13-Oct-19 20:30
professionalpkfox13-Oct-19 20:30 
GeneralRe: What a game of rugby Pin
PeejayAdams13-Oct-19 22:08
PeejayAdams13-Oct-19 22:08 
GeneralMath noob question ;) Pin
User 1106097913-Oct-19 4:08
User 1106097913-Oct-19 4:08 
GeneralRe: Math noob question ;) Pin
Peter_in_278013-Oct-19 4:35
professionalPeter_in_278013-Oct-19 4:35 
GeneralRe: Math noob question ;) Pin
User 1106097913-Oct-19 4:47
User 1106097913-Oct-19 4:47 
GeneralRe: Math noob question ;) Pin
Peter_in_278013-Oct-19 13:47
professionalPeter_in_278013-Oct-19 13:47 
GeneralRe: Math noob question ;) Pin
User 1106097914-Oct-19 7:39
User 1106097914-Oct-19 7:39 
GeneralRe: Math noob question ;) Pin
kalberts15-Oct-19 7:19
kalberts15-Oct-19 7:19 
Peter_in_2780 wrote:
If only mathematicians could become zero-based.
That causes a lot of problems with number lines that do not have a zero. E.g. years go directly from -1 to +1; there never was a year zero. The elevator in our office building goes directly from floor 1 to floor -1. (To ease our minds, we have declared that the building does have a floor zero, but it is virtual, and the elevator is not built to stop at virtual locations.)

My wish is that we go back to the days of Pascal. If your array indexes run from 1950 to 2050, that is perfectly fine! If they run from 0 to 99, or from 1 to 100 - both are perfectly fine. Just tell what you want, and the compiler takes care of offsetting the index you are using in your program so that the element at the lowest index runs from the base memory address of the array. Compilers are quite good at doing that sort of calculations Smile | :) - it is a pity that the C group of languages forces us to do this sort of offsetting in application code.

Some hardware helps with trivialities: I once worked on a machine providing an instruction called MIX3: It decremented the value in the accumulator by 1, then multiplied it by 3. This was in the Fortran days: Fortran arrays are 1-based, and this 16-bit mini, adressing 16 bit words rather than bytes, used a 48-bit (3 word) float format. So MIX3 converted a "logical" (1-based) Fortran array index into a word offset from the (0-based) memory base address.

Handling discontinous number series, such as years around the start of our "Common Era", will always require special handling, though.
GeneralRe: Math noob question ;) and wandering OT Pin
Peter_in_278015-Oct-19 16:22
professionalPeter_in_278015-Oct-19 16:22 
GeneralRe: Math noob question ;) Pin
peterkmx14-Oct-19 2:31
professionalpeterkmx14-Oct-19 2:31 
GeneralRe: Math noob question ;) Pin
User 1106097914-Oct-19 7:36
User 1106097914-Oct-19 7:36 
GeneralRe: Math noob question ;) Pin
Marc Clifton14-Oct-19 8:33
mvaMarc Clifton14-Oct-19 8:33 
GeneralRe: Math noob question ;) Pin
Peter_in_278014-Oct-19 21:11
professionalPeter_in_278014-Oct-19 21:11 
GeneralRe: Math noob question ;) Pin
User 1106097915-Oct-19 9:16
User 1106097915-Oct-19 9:16 
GeneralRe: Math noob question ;) Pin
kalberts15-Oct-19 7:03
kalberts15-Oct-19 7:03 
QuestionMobile Call madness? Pin
DaveAuld12-Oct-19 21:53
professionalDaveAuld12-Oct-19 21:53 
AnswerRe: Mobile Call madness? Pin
RickZeeland12-Oct-19 22:10
mveRickZeeland12-Oct-19 22:10 
GeneralRe: Mobile Call madness? Pin
DaveAuld12-Oct-19 22:14
professionalDaveAuld12-Oct-19 22:14 
AnswerRe: Mobile Call madness? Pin
OriginalGriff12-Oct-19 23:18
mveOriginalGriff12-Oct-19 23:18 
AnswerRe: Mobile Call madness? Pin
Greg Utas13-Oct-19 2:20
professionalGreg Utas13-Oct-19 2:20 
AnswerRe: Mobile Call madness? Pin
Randor 13-Oct-19 2:51
professional Randor 13-Oct-19 2:51 
AnswerRe: Mobile Call madness? Pin
abmv13-Oct-19 5:49
professionalabmv13-Oct-19 5:49 
AnswerRe: Mobile Call madness? Pin
Kschuler14-Oct-19 5:18
Kschuler14-Oct-19 5:18 
GeneralRe: Mobile Call madness? Pin
jeron114-Oct-19 5:33
jeron114-Oct-19 5:33 
GeneralDatabase clusters Pin
RickZeeland12-Oct-19 21:40
mveRickZeeland12-Oct-19 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.