Skip to content

The month returned by the Get SysInfo command is off by 1 #5

@j4james

Description

@j4james

In the Get SysInfo command, the documentation for the current date just says it should return:

((year - 1900) * 256 * 256) + (month * 256) + (day of month)

It doesn't explicitly declare the range of the month and day of month fields, but I think most people would assume a month in the range 1 to 12, and a day of month in the range 1 to 31, unless specified otherwise.

However, it appears that FBBI is returning the month in the range 0 to 11. Looking at the code, my impression is it's just using what the C stdlib tm_mon field returns, and wasn't actually a conscious decision. So I may be wrong, but I'm assuming this is a bug.

It's also worth mentioning that every other Befunge-98 interpreter I've tested* has gone with a month range of 1 to 12, so FBBI certainly appears to be the odd one out in this regard.

[*] I've tried CCBI, Fungi, PyFunge, cfunge, and Rc/Funge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions