Skip to content

"container full" is no properly calculated #1

Description

@JannIds

I tried to use sample "Check how many packages can be fitter into a given container"

$container = new Container(64, 39, 38);
$packages = [
new Package(30, 30, 24),
new Package(30, 30, 24),
new Package(30, 30, 24),
new Package(30, 30, 24),
new Package(30, 30, 24),
];

it doesn't show that container is full.
my responses are:
Package volume: int(108000)
Container volume: int(94848)
Container waste %: int(-13)
Container waste volume: int(-13152)
Container FULL: bool(false)

waste goes to negative, so i assume it is oversized of the container.

But in real life only 2 packages fits in container????

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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