Skip to content

One Bug I think in "S7.net\Types\Struct.cs"  #206

@tsheyu

Description

@tsheyu

Hi, Michael:
in "S7.net\Types\Struct.cs"

                 case "Double":
                     numBytes = Math.Ceiling(numBytes);
                     if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
                         numBytes++;
                     numBytes += 4;
                     break;
                 default:
                     numBytes += GetStructSize(info.FieldType);
                     break;

I think in the Default case also need a function

numBytes = Math.Ceiling(numBytes);
if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
                      numBytes++;

Functions "FromBytes", "ToBytes", "GetStructSize" are affected. Please have a look~~~

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