Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#4864 closed defect (invalid)

Still not the right value in 11701 after accidental remove fix.

Reported by: Bust3D Owned by:
Priority: Please fill in Component: ! Please select...
Severity: Please fill in Keywords:
Cc: Sensitive: no

Description

Revision

11701

Issue Description

This was before accidental cosmetics remove !
(((OSCAM_STACK_MIN) / pagesize) + 1) * pagesize;

and this is now in 11701:
oscam_stacksize = ((OSCAM_STACK_MIN) / pagesize + 1) * pagesize;

Result

(((OSCAM_STACK_MIN) / pagesize) + 1) * pagesize; will never equals to oscam_stacksize = ((OSCAM_STACK_MIN) / pagesize + 1) * pagesize;

(8 / 4) + 1 * 1
(8 / 4+1) * 1 ===> actual in 11701 will add one plus to pagesize and divide wrong then and will be not the same size as was before accidental remove.

This is the right value.
(((OSCAM_STACK_MIN) / pagesize) + 1) * pagesize;

Simple Math.

Change History (5)

comment:1 by samur, 2 years ago

#include <iostream>
int main()
{
printf("%d\n", ( (((64000 + 32768 ) / 10) + 1) * 10) );
printf("%d\n", ( ((64000 + 32768 ) / 10 + 1) * 10) );
}

Result

96770
96770

;

Last edited 2 years ago by samur (previous) (diff)

comment:2 by nautilus7, 2 years ago

You need to refresh your math, I believe...

Last edited 2 years ago by nautilus7 (previous) (diff)

comment:3 by nautilus7, 2 years ago

For example with

OSCAM_STACK_MIN equal to 64000 + 32768
pagesize equal to 10

we have

with 11699:
oscam_stacksize = (((OSCAM_STACK_MIN) / pagesize) + 1) * pagesize

(((64000 + 32768 ) / 10) + 1) * 10

(((96768 ) / 10) + 1) * 10

(( 96768 / 10) + 1) * 10

(( 9676 ) + 1) * 10

(( 9676 + 1) * 10

( 9677 ) * 10

9677 * 10

96770

with 11701
oscam_stacksize = ((OSCAM_STACK_MIN) / pagesize + 1) * pagesize

((64000 + 32768 ) / 10 + 1) * 10

((96768 ) / 10 + 1) * 10

( 96768 / 10 + 1) * 10

( 9676 + 1) * 10

( 9677 ) * 10

9677 * 10

96770

comment:4 by Bust3D, 2 years ago

Resolution: invalid
Status: newclosed

You have right !

int main()
{

printf("%d\n", ( (((64000 + 32768 ) / 10) + 1) * 10) );
printf("%d\n", ( ((64000 + 32768 ) / 10 + 1) * 10) );

}

has same result!
Thanks for math lesson :)

comment:5 by nautilus7, 2 years ago

No prob. Cheers

Note: See TracTickets for help on using tickets.