Page 1 of 1

1 = 1 ?

Posted: Mon Sep 23, 2013 1:37 pm
by minicooper97de
hi all,

i have something curious... try this in your message box:

Code: Select all

put "700901001234567890131400" into x;add 0 to x; put x

perhaps there is a reason - but i do not know - do you?

andi

Re: 1 = 1 ?

Posted: Mon Sep 23, 2013 6:19 pm
by dunbarx
Hmmm.

I get:

700901001234567890131400

Craig Newman

Re: 1 = 1 ?

Posted: Mon Sep 23, 2013 6:37 pm
by jmburnod
Strange result for me too
I get:

700901001234567940538368

Best
Jean-Marc

Re: 1 = 1 ?

Posted: Mon Sep 23, 2013 10:16 pm
by dunbarx
I get the same output as input.

Jean-Marc, are you really getting the last third of the number mixed up?

And miniCooper. are you getting something similar? The number is 24 digits long. Does a shorter one, say 16 or 20 digits, come out as it should?

Craig

Re: 1 = 1 ?

Posted: Tue Sep 24, 2013 2:38 am
by dave_probertGA6e24
Hi,

On both 5.5.5 and 6.1.1, I too get the messed up number. Same one as JM.

Code: Select all

put "11111111111111111" into x;add 0 to x; put x
productes: 11111111111111112

Adding 1's into there makes the output number even stranger.

I'm guessing that the eval of the string to number can't handle larger numbers properly (in the messagebox, at least)

Cheers,
Dave

Re: 1 = 1 ?

Posted: Tue Sep 24, 2013 3:14 am
by Simon
About 5 months ago this was brought up on the Dev list, there are apparently ways to work around this.
You only get 16 digits using the standard liveCode arithmetic.

Simon

Re: 1 = 1 ?

Posted: Tue Sep 24, 2013 9:58 am
by minicooper97de
Simon wrote:About 5 months ago this was brought up on the Dev list, there are apparently ways to work around this.
You only get 16 digits using the standard liveCode arithmetic.

Simon
thanks simon, this seems to be the problem...
i have to calculate a checksum like:

700901001234567890131400 mod 97

the result in livecode: 38
the correct result: 90

very frustrating - not to get any hints or errors just an incorrct result.

anyone out there with a solution????

thanks in advance, andi

Re: 1 = 1 ?

Posted: Tue Sep 24, 2013 11:45 am
by jmburnod
Hi Craig
Jean-Marc, are you really getting the last third of the number mixed up?
Yes

Jean-Marc