Re: Why am I getting a dividing by zero error message

2021-01-28 Thread tsbockman via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: Here is the output/input of the program: Type in data for an egg: Width: 3 Hight: 2 object.Error@(0): Integer Divide by Zero ... Here is the source code: import std.stdio; import std.string; void main(){ egg[1000]

Re: Why am I getting a dividing by zero error message

2021-01-28 Thread Ruby The Roobster via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:56:45 UTC, Ruby The Roobster wrote: On Thursday, 28 January 2021 at 18:53:51 UTC, Dennis wrote: On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: object.Error@(0): Integer Divide by Zero Why is this happening? Does anybody know?

Re: Why am I getting a dividing by zero error message

2021-01-28 Thread Ruby The Roobster via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:53:51 UTC, Dennis wrote: On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: object.Error@(0): Integer Divide by Zero Why is this happening? Does anybody know? data[0] = (new egg(0,0,"a")); Here you set data[0].y to 0 tempb =

Re: Why am I getting a dividing by zero error message

2021-01-28 Thread evilrat via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: Here is the output/input of the program: Type in data for an egg: Width: 3 Hight: 2 object.Error@(0): Integer Divide by Zero 0x004023FE 0x0040CF9F 0x0040CF19 0x0040CDB4 0x00409033 0x00402638 0x75F86359 in

Re: Why am I getting a dividing by zero error message

2021-01-28 Thread jmh530 via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: Here is the output/input of the program: Type in data for an egg: Width: 3 Hight: 2 [...] It might help to separate break this out into smaller functions. May make it easier to follow what is happening.

Re: Why am I getting a dividing by zero error message

2021-01-28 Thread Dennis via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: object.Error@(0): Integer Divide by Zero Why is this happening? Does anybody know? data[0] = (new egg(0,0,"a")); Here you set data[0].y to 0 tempb = data[x].y; In the first iteration, this equals data[0].y which

Why am I getting a dividing by zero error message

2021-01-28 Thread Ruby The Roobster via Digitalmars-d-learn
Here is the output/input of the program: Type in data for an egg: Width: 3 Hight: 2 object.Error@(0): Integer Divide by Zero 0x004023FE 0x0040CF9F 0x0040CF19 0x0040CDB4 0x00409033 0x00402638 0x75F86359 in BaseThreadInitThunk 0x77018944 in RtlGetAppContainerNamedObjectPath